Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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.