Reply
JJH
New Contributor
Posts: 2
Registered: ‎05-01-2016

How to rename kudu table name on impala version 2.12

[ Edited ]

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.

 

Expert Contributor
Posts: 123
Registered: ‎07-17-2017

Re: How to rename kudu table name on impala version 2.12

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.

JJH
New Contributor
Posts: 2
Registered: ‎05-01-2016

Re: How to rename kudu table name on impala version 2.12

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.

Expert Contributor
Posts: 123
Registered: ‎07-17-2017

Re: How to rename kudu table name on impala version 2.12

Hi @JJH

How do you create this kudu table ? Did you use Impala ?!

New Contributor
Posts: 4
Registered: ‎07-20-2016

Re: How to rename kudu table name on impala version 2.12

ALTER TABLE table_name SET TBLPROPERTIES('kudu.table_name'='newtablename');

New Contributor
Posts: 1
Registered: ‎07-19-2018

Re: How to rename kudu table name on impala version 2.12

[ Edited ]

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

  1. Take table, rename to new table name
  2. Create new table with the original table's name
  3. Insert data from old table into new table
  4. 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.

 

Expert Contributor
Posts: 123
Registered: ‎07-17-2017

Re: How to rename kudu table name on impala version 2.12

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.

Announcements