Created on 09-30-2015 08:59 PM - edited 09-16-2022 02:42 AM
Hello,
I need to use the TRUNCATE command, however
when I the folowing command
TRUNCATE TABLE table_name PARTITION (datebymonth='2014-10')
in impala-shell I get an error:
ERROR: AnalysisException: Syntax error in line 6: TRUNCATE TABLE user_events ... ^ Encountered: IDENTIFIER Expected: ALTER, COMPUTE, CREATE, DESCRIBE, DROP, EXPLAIN, GRANT, INSERT, INVALIDATE, LOAD, REFRESH, REVOKE, SELECT, SET, SHOW, USE, VALUES, WITH
In hue impala editor everything is fine.
Note: I need to use the impala-shell because I add these queries in a cron job.
The impala version that I use: v2.1.4-cdh5
Cloudera version: CDH 5.3
Thank you!
Created 10-02-2015 05:53 AM
Impala currently does not support truncating an individual partition, so that syntax error you get from the shell is expected.
I am not sure why the statement appears to work from Hue. The TRUNCATE TABLE ... PARTITION syntax is not supported, so I don't see how this would work.
Perhaps the error is somehow not properly shown/propagated to Hue?
Created 10-02-2015 05:53 AM
Impala currently does not support truncating an individual partition, so that syntax error you get from the shell is expected.
I am not sure why the statement appears to work from Hue. The TRUNCATE TABLE ... PARTITION syntax is not supported, so I don't see how this would work.
Perhaps the error is somehow not properly shown/propagated to Hue?
Created 10-02-2015 07:01 AM
Effectivly, TRUNCATE doesn't apear in
Created 10-04-2015 05:40 PM
Thanks for the notice, it could be an oversight with the docs. I'll look into it.