- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to rename kudu table name on impala version 2.12
- Labels:
-
Apache Impala
-
Apache Kudu
Created on ‎04-17-2018 10:37 PM - edited ‎09-16-2022 06:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I'm using Impala on CDH 5.15.0 in our cluster
(version of impala, 2.12)
I try to kudu table rename but occured exception with this message.
ERROR: AnalysisException: Not allowed to set 'kudu.table_name' manually for managed Kudu tables.
I read achive on jira : link
then how can i rename kudu table using impala?
thanks.
Created ‎04-18-2018 01:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @JJH,
I think you have to rename it using the impala statement below:
ALTER TABLE your_table RENAME TO new_table_name;
Good luck.
Created ‎04-25-2018 05:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @AcharkiMed.
But, That's rename query for change impala table.
I want to know rename query for change kudu table.
I appreciate your help.
Created ‎04-26-2018 03:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @JJH
How do you create this kudu table ? Did you use Impala ?!
Created ‎07-13-2018 03:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ALTER TABLE table_name SET TBLPROPERTIES('kudu.table_name'='newtablename');
Created on ‎07-19-2018 09:39 PM - edited ‎07-19-2018 09:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately neither of these approaches seem to work. (CDH5.15 Kudu 1.7)
ALTER TABLE your_table RENAME TO new_table_name;
-> Works but it renames the table in the Impala/Hive metastore but *doesn't* rename the underlying Kudu table.
ALTER TABLE table_name SET TBLPROPERTIES('kudu.table_name'='newtablename');
-> Doesn't work at all (as per ERROR: AnalysisException: Not allowed to set 'kudu.table_name' manually for managed Kudu tables.)
Use case - large (non-additive) schema change for a table
- Take table, rename to new table name
- Create new table with the original table's name
- Insert data from old table into new table
- Archive / decom old table
Step 2 breaks because the underlying Kudu table for the renamed talbe in step1 still retains the name of the original table.
Created ‎07-20-2018 02:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI @Derek
Try this workaround:
1- Create new table with the original table's data.
2- Drop all data from old table (using delete).
3- Insert data from new table into old table.
4- Drop new table.
Good luck.
Created on ‎09-14-2018 02:58 AM - edited ‎09-14-2018 02:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Execute below queries in Impala:
ALTER TABLE old_table RENAME TO new_table;
ALTER TABLE new_table SET TBLPROPERTIES('kudu.table_name'='new_table');
Always use new_table for second alter query.
Created ‎09-21-2018 07:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
this worked, thanks
Created ‎09-21-2018 06:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Ankit_Mishra's answer is the correct way to do the procedure you want to do, Impala doesn't allow for separately managing the Kudu and Impala tables if you create the Kudu table through Impala.
