IMPALA-6929: Support multi-column range partitions for Kudu

Kudu allows specifying range partitions over multiple columns. Impala
already has support for doing this when the partitions are specified
with '=', but if the partitions are specified with '<' or '<=', the
parser would return an error.

This patch modifies the parser to allow for creating Kudu tables like:
create table kudu_test (a int, b int, primary key(a, b))
  partition by range(a, b) (partition (0, 0) <= values < (1, 1));
and similary to alter partitions like:
alter table kudu_test add range partition (1, 1) <= values < (2, 2);

Testing:
- Modified functional_kudu.jointbl's schema so that we have a table
  in functional with a multi-column range partition to test things
  against.
- Added FE and E2E tests for CREATE and ALTER.

Change-Id: I0141dd3344a4f22b186f513b7406f286668ef1e7
Reviewed-on: http://gerrit.cloudera.org:8080/10441
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
Thomas Tauber-Marshall
2018-05-15 17:20:28 -07:00
committed by Impala Public Jenkins
parent 8d49797194
commit bf2124bf30
6 changed files with 115 additions and 33 deletions

View File

@@ -822,8 +822,11 @@ create table {db_name}{db_suffix}.{table_name} (
alltypes_id int,
primary key (test_id, test_name, test_zip, alltypes_id)
)
partition by range(test_id) (partition values <= 1003, partition 1003 < values <= 1007,
partition 1007 < values) stored as kudu;
partition by range(test_id, test_name)
(partition values <= (1003, 'Name3'),
partition (1003, 'Name3') < values <= (1007, 'Name7'),
partition (1007, 'Name7') < values)
stored as kudu;
====
---- DATASET
functional