Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Impala-Shell vs Impala in Hue

avatar
Champion Alumni

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!

 

GHERMAN Alina
1 ACCEPTED SOLUTION

avatar

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?

 

View solution in original post

3 REPLIES 3

avatar

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?

 

avatar
Champion Alumni

avatar

Thanks for the notice, it could be an oversight with the docs. I'll look into it.