09-24-2018 07:16 AM
I can't remove the upper range partition of a kudu table and it seems to be because of the "greater than" sign... Can somebody tell me what I'm doing wrong?
Example Table "test_sql_drop":
HASH (flowEndDate, uniqueID) PARTITIONS 16, RANGE (flowEndDate) ( PARTITION VALUES < 1535102117, PARTITION 1535102117 <= VALUES < 1535188517, PARTITION 1536138917 <= VALUES < 1536225317, PARTITION 1536225317 <= VALUES < 1536311717, PARTITION VALUES >= 1536311717 )
The following query to remove the lower limit works like a charm:
ALTER TABLE test_sql_drop DROP RANGE PARTITION VALUES < 1535102117;
However, if I try the same with the upper limit, it doesn't work:
ALTER TABLE test_sql_drop DROP RANGE PARTITION VALUES >= 1536311717; java.sql.SQLException: [Cloudera][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:AnalysisException: Syntax error in line 1: ...OP RANGE PARTITION VALUES >= 1536311717; ^ Encountered: > Expected: COMMA CAUSED BY: Exception: Syntax error ), Query: ALTER TABLE test_sql_drop DROP RANGE PARTITION VALUES >= 1536311717;. at com.cloudera.impala.hivecommon.api.HS2Client.executeStatementInternal(Unknown Source) at com.cloudera.impala.hivecommon.api.HS2Client.executeStatement(Unknown Source) ....
Pretty simple question, but now we stuck because we can't extend the upper limit of our kudu tables (at least with JDBC Impala Driver).
Thanks in advance. Cheers
09-25-2018 12:24 AM
Thanks to the getkudu Slack Channel I found a solution for my issue. Just in case someone else is facing this as well, just reorder the "VALUES" string and the "Number" in a way that you can use "<=" instead of ">="...
ALTER TABLE test_sql_drop DROP RANGE PARTITION VALUES >= 1536311717;
ALTER TABLE test_sql_drop DROP RANGE PARTITION 1536311717 <= VALUES;