Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
Impala 2.12.0
-
ghx-label-7
Description
Table creation succeeds this way:
CREATE TABLE test3 ( source_system_id BIGINT, id1 BIGINT, id2 BIGINT, name STRING, PRIMARY KEY (source_system_id,id1,id2) ) PARTITION BY HASH(id1,id2) PARTITIONS 10, RANGE(source_system_id) ( PARTITION VALUE = 10000000, PARTITION VALUE = 20000000, PARTITION VALUE = 30000000 ) STORED AS KUDU;
However, it fails with a syntax error if we swap the order of HASH() and RANGE():
CREATE TABLE test3 ( source_system_id BIGINT, id1 BIGINT, id2 BIGINT, name STRING, PRIMARY KEY (source_system_id,id1,id2) ) PARTITION BY RANGE(source_system_id) ( PARTITION VALUE = 10000000, PARTITION VALUE = 20000000, PARTITION VALUE = 30000000 ), HASH(id1,id2) PARTITIONS 10 STORED AS KUDU;
I think we shouldn't restrict the order of RANGE() and HASH().
Check the relevant accepted syntax here:
https://github.com/apache/impala/blob/6568e6e110e507f5228c1da11e56fd7117ab8a25/fe/src/main/cup/sql-parser.cup#L1416