IMPALA-3726: Add support for Kudu-specific column options

This commit adds support for Kudu-specific column options in CREATE
TABLE statements. The syntax is:
CREATE TABLE tbl_name ([col_name type [PRIMARY KEY] [option [...]]] [, ....])
where option is:
| NULL
| NOT NULL
| ENCODING encoding_val
| COMPRESSION compression_algorithm
| DEFAULT expr
| BLOCK_SIZE num

The output of the SHOW CREATE TABLE statement was altered to include all the specified
column options for Kudu tables.

Change-Id: I727b9ae1b7b2387db752b58081398dd3f3449c02
Reviewed-on: http://gerrit.cloudera.org:8080/5026
Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Tested-by: Internal Jenkins
This commit is contained in:
Dimitris Tsirogiannis
2016-11-09 15:11:07 -08:00
committed by Internal Jenkins
parent 60414f0633
commit 3db5ced4ce
31 changed files with 973 additions and 254 deletions

View File

@@ -1,8 +1,8 @@
====
---- QUERY
create table tdata
(id int primary key, valf float, vali bigint, valv string, valb boolean, valt tinyint,
vals smallint, vald double)
(id int primary key, valf float null, vali bigint null, valv string null,
valb boolean null, valt tinyint null, vals smallint null, vald double null)
DISTRIBUTE BY RANGE (PARTITION VALUES < 100, PARTITION 100 <= VALUES < 1000,
PARTITION 1000 <= VALUES <= 10000) STORED AS KUDU
---- RESULTS
@@ -297,8 +297,9 @@ INT,FLOAT,BIGINT,STRING,BOOLEAN,TINYINT,SMALLINT,DOUBLE
====
---- QUERY
create table multiple_key_cols
(string_col string, bigint_col bigint, tinyint_col tinyint, smallint_col smallint,
bool_col boolean, int_col int, double_col double, float_col float,
(string_col string, bigint_col bigint, tinyint_col tinyint,
smallint_col smallint, bool_col boolean null, int_col int null,
double_col double null, float_col float null,
primary key (string_col, bigint_col, tinyint_col, smallint_col))
DISTRIBUTE BY HASH (string_col) INTO 16 BUCKETS STORED AS KUDU
====

View File

@@ -1,8 +1,8 @@
====
---- QUERY
create table tdata
(id int primary key, valf float, vali bigint, valv string, valb boolean, valt tinyint,
vals smallint, vald double)
(id int primary key, valf float null, vali bigint null, valv string null,
valb boolean null, valt tinyint null, vals smallint null, vald double null)
DISTRIBUTE BY RANGE (PARTITION VALUES < 10, PARTITION 10 <= VALUES < 30,
PARTITION 30 <= VALUES) STORED AS KUDU
---- RESULTS

View File

@@ -1,8 +1,9 @@
====
---- QUERY
create table tdata
(id int primary key, name string, valf float, vali bigint, valv string, valb boolean,
valt tinyint, vals smallint, vald double)
(id int primary key, name string null, valf float null, vali bigint null,
valv string null, valb boolean null, valt tinyint null, vals smallint null,
vald double null)
DISTRIBUTE BY RANGE (PARTITION VALUES < 10, PARTITION 10 <= VALUES < 30,
PARTITION 30 <= VALUES <= 10000) STORED AS KUDU
---- RESULTS
@@ -337,4 +338,4 @@ update tdata set vali = -1
---- RUNTIME_PROFILE
NumModifiedRows: 7300
NumRowErrors: 0
====
====

View File

@@ -1,8 +1,9 @@
====
---- QUERY
create table tdata
(id int primary key, name string, valf float, vali bigint, valv string, valb boolean,
valt tinyint, vals smallint, vald double)
(id int primary key, name string null, valf float null, vali bigint null,
valv string null, valb boolean null, valt tinyint null, vals smallint null,
vald double null)
DISTRIBUTE BY RANGE (PARTITION VALUES < 10, PARTITION 10 <= VALUES < 30,
PARTITION 30 <= VALUES) STORED AS KUDU
---- RESULTS
@@ -389,8 +390,8 @@ NumRowErrors: 0
---- QUERY
create table multiple_key_cols
(string_col string, bigint_col bigint, tinyint_col tinyint, smallint_col smallint,
bool_col boolean, int_col int, double_col double, float_col float,
primary key (string_col, bigint_col, tinyint_col, smallint_col))
bool_col boolean null, int_col int null, double_col double null,
float_col float null, primary key (string_col, bigint_col, tinyint_col, smallint_col))
DISTRIBUTE BY HASH (string_col) INTO 16 BUCKETS STORED AS KUDU
====
---- QUERY
@@ -488,4 +489,4 @@ upsert into table multiple_key_cols
(string_col, tinyint_col, smallint_col) values ('a', 1, 1)
---- CATCH
All primary key columns must be specified for UPSERTing into Kudu tables. Missing columns are: bigint_col
====
====