Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on
09-30-2015
08:59 PM
- last edited on
04-21-2026
06:57 AM
by
GrazittiAPI
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.