Created on 04-17-2018 10:37 PM - edited 04-17-2018 10:39 PM
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
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
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
Hi @JJH
How do you create this kudu table ? Did you use Impala ?!
Created 07-13-2018 03:30 PM
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
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
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
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
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
this worked, thanks
Created 09-21-2018 06:35 PM
@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.
Created 09-21-2018 06:37 PM
Yep, that worked a treat. Thanks.
Created 09-22-2018 12:18 AM
Created 09-25-2018 04:08 PM
Just following up here, I just tested this on Impala version 2.13 (dev version) and I cannot reproduce the ability to alter table set tblproperties to rename the Kudu table name even after altering the Impala table name. Is anyone else able to reproduce this? I get the following error:
> alter table mpercy_k2 set tblproperties('kudu.table_name'='impala::default.mpercy_k2');
Query: alter table mpercy_k2 set tblproperties('kudu.table_name'='impala::default.mpercy_k2')
ERROR: AnalysisException: Not allowed to set 'kudu.table_name' manually for managed Kudu tables .
However this is by design from what I have discussed with some others.
I think the "bug" is that Impala alter table doesn't automatically rename the Kudu table internally. However it would be a security problem to be able to alter the kudu table name with tblproperties because Sentry applies the security rules to the Impala table name.
Created on 09-28-2018 11:36 AM - edited 09-28-2018 11:36 AM
FYI, I think my reply from 9/21 was wrong. As far as I can tell, the rules work as follows:
1. If the Kudu table is managed by Impala, it's not possible to change the kudu.table_name and kudu.master_addresses properties. This is the case when it's not an EXTERNAL table. See https://issues.apache.org/jira/browse/IMPALA-5654 for more information on that.
I have filed an improvement request to track automatically renaming the Kudu table when the Impala table is renamed to keep them in sync, but right now it's not possible. See https://issues.apache.org/jira/browse/IMPALA-7640 for more information.
2. If you have an EXTERNAL table (Kudu table not managed by Impala) then you are able to alter the kudu.table_name table property.
The above was tested on a non-secure cluster, and I would be interested to hear if others' experiences are the same as mine were even on a secured cluster. However I believe the behavior is the same in both cases.
Hope this helps,
Mike
Created on 11-05-2018 08:48 AM - edited 11-05-2018 08:52 AM
I tried the alter command below in impala-shell 2.12.0 and kudu 1.7.0. However, I'm getting an error. My table is an external table in impala.
The error message is strange. Of course the new table doesn't exists, I want to create it with the command...
ALTER TABLE res_dhcp_int SET TBLPROPERTIES('kudu.table_name'='res_dhcp_int');
Query: ALTER TABLE res_dhcp_int SET TBLPROPERTIES('kudu.table_name'='res_dhcp_int')
ERROR: TableLoadingException: Error loading metadata for Kudu table res_dhcp_int
CAUSED BY: ImpalaRuntimeException: Error opening Kudu table 'res_dhcp_int', Kudu error: The table does not exist: table_name: "res_dhcp_int"
is this a bug?
EDIT: i just read IMPALA-5654, seems that with impala 2.12.0 this alter command doesn't work anymore! I need an alternative for that 😞