mirror of
https://github.com/apache/impala.git
synced 2026-01-06 06:01:03 -05:00
This commit adds support for non-covering range partitions in Kudu
tables. The SPLIT ROWS clause is now deprecated and no longer supported.
The following new syntax provides more flexibility in creating range
partitions and it supports bounded and unbounded ranges as well as single value
partitions; multi-column range partitions are supported as well.
The new syntax is:
DISTRIBUTE BY RANGE (col_list)
(
PARTITION lower_1 <[=] VALUES <[=] upper_1,
PARTITION lower_2 <[=] VALUES <[=] upper_2,
....
PARTITION lower_n <[=] VALUES <[=] upper_n,
PARTITION VALUE = val_1,
....
PARTITION VALUE = val_n
)
Multi-column range partitions are specified as follows:
DISTRIBUTE BY RANGE (col1, col2,..., coln)
(
PARTITION VALUE = (col1_val, col2_val, ..., coln_val),
....
PARTITION VALUE = (col1_val, col2_val, ..., coln_val)
)
Change-Id: I6799c01a37003f0f4c068d911a13e3f060110a06
Reviewed-on: http://gerrit.cloudera.org:8080/4856
Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Tested-by: Internal Jenkins
32 lines
807 B
Plaintext
32 lines
807 B
Plaintext
====
|
|
---- QUERY
|
|
create table simple (id int primary key, name string, valf float, vali bigint)
|
|
distribute by range (partition values < 10, partition 10 <= values < 30,
|
|
partition 30 <= values) stored as kudu tblproperties('kudu.num_tablet_replicas' = '2')
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
show table stats simple
|
|
---- RESULTS
|
|
-1,'','8000000A',regex:.*?:\d+,2
|
|
-1,'8000000A','8000001E',regex:.*?:\d+,2
|
|
-1,'8000001E','',regex:.*?:\d+,2
|
|
---- TYPES
|
|
INT,STRING,STRING,STRING,INT
|
|
---- LABELS
|
|
# Rows,Start Key,Stop Key,Leader Replica,# Replicas
|
|
====
|
|
---- QUERY
|
|
# IMPALA-3373: Computing stats on a Kudu table lead to duplicate columns shown for the
|
|
# table.
|
|
compute stats simple;
|
|
describe simple;
|
|
---- RESULTS
|
|
'id','int',''
|
|
'name','string',''
|
|
'valf','float',''
|
|
'vali','bigint',''
|
|
---- TYPES
|
|
STRING,STRING,STRING
|
|
====
|