blob: 17d365b94be7f2a5e4c112b37f3446bfa0596c54 [file] [log] [blame]
====
---- QUERY
-- Test hash partitioning
create table simple_hash (id int, name string, valf float, vali bigint,
primary key (id, name)) partition by hash(id) partitions 4,
hash(name) partitions 2 stored as kudu
---- RESULTS
'Table has been created.'
====
---- QUERY
show table stats simple_hash
---- LABELS
# Rows,Start Key,Stop Key,Leader Replica,# Replicas
---- RESULTS
-1,'','0000000000000001',regex:.*?:\d+,3
-1,'0000000000000001','00000001',regex:.*?:\d+,3
-1,'00000001','0000000100000001',regex:.*?:\d+,3
-1,'0000000100000001','00000002',regex:.*?:\d+,3
-1,'00000002','0000000200000001',regex:.*?:\d+,3
-1,'0000000200000001','00000003',regex:.*?:\d+,3
-1,'00000003','0000000300000001',regex:.*?:\d+,3
-1,'0000000300000001','',regex:.*?:\d+,3
---- TYPES
INT,STRING,STRING,STRING,INT
====
---- QUERY
-- Test single column range partitioning with bounded and unbounded partitions
create table range_part_bounds (id int, name string, valf float, vali bigint,
primary key (id, name)) partition by range (id)
(partition values <= 10, partition 10 < values <= 20, partition 20 < values)
stored as kudu
---- RESULTS
'Table has been created.'
====
---- QUERY
show table stats range_part_bounds
---- LABELS
# Rows,Start Key,Stop Key,Leader Replica,# Replicas
---- RESULTS
-1,'','8000000B',regex:.*?:\d+,3
-1,'8000000B','80000015',regex:.*?:\d+,3
-1,'80000015','',regex:.*?:\d+,3
---- TYPES
INT,STRING,STRING,STRING,INT
====
---- QUERY
-- Test single column range partitioning with single value partitions
create table range_part_single (id int, name string, valf float, vali bigint,
primary key (id, name)) partition by range (id)
(partition value = 1, partition value = 10, partition value = 100)
stored as kudu
---- RESULTS
'Table has been created.'
====
---- QUERY
show table stats range_part_single
---- LABELS
# Rows,Start Key,Stop Key,Leader Replica,# Replicas
---- RESULTS
-1,'80000001','80000002',regex:.*?:\d+,3
-1,'8000000A','8000000B',regex:.*?:\d+,3
-1,'80000064','80000065',regex:.*?:\d+,3
---- TYPES
INT,STRING,STRING,STRING,INT
====
---- QUERY
-- Test single column range partitioning with bounded, unbounded and single
-- value partitions
create table range_part_multiple_bounds (id int, name string, valf float,
primary key (id, name)) partition by range (id)
(partition values <= 10, partition 10 < values <= 20, partition 20 < values <= 30,
partition value = 40, partition value = 50) stored as kudu
---- RESULTS
'Table has been created.'
====
---- QUERY
show table stats range_part_multiple_bounds
---- LABELS
# Rows,Start Key,Stop Key,Leader Replica,# Replicas
---- RESULTS
-1,'','8000000B',regex:.*?:\d+,3
-1,'8000000B','80000015',regex:.*?:\d+,3
-1,'80000015','8000001F',regex:.*?:\d+,3
-1,'80000028','80000029',regex:.*?:\d+,3
-1,'80000032','80000033',regex:.*?:\d+,3
---- TYPES
INT,STRING,STRING,STRING,INT
====
---- QUERY
-- Test multiple column range partitioning
create table range_part_multiple_cols (id int, name string, valf float, vali bigint,
primary key (id, name)) partition by range (id, name)
(partition value = (10, 'martin'), partition value = (20, 'dimitris'),
partition value = (30, 'matthew')) stored as kudu
---- RESULTS
'Table has been created.'
====
---- QUERY
-- Test printing of multiple column range partitioning
show range partitions range_part_multiple_cols
---- RESULTS
'VALUE = (10, "martin")'
'VALUE = (20, "dimitris")'
'VALUE = (30, "matthew")'
====
---- QUERY
show table stats range_part_multiple_cols
---- LABELS
# Rows,Start Key,Stop Key,Leader Replica,# Replicas
---- RESULTS
-1,'8000000A6D617274696E','8000000A6D617274696E00',regex:.*?:\d+,3
-1,'8000001464696D6974726973','8000001464696D697472697300',regex:.*?:\d+,3
-1,'8000001E6D617474686577','8000001E6D61747468657700',regex:.*?:\d+,3
---- TYPES
INT,STRING,STRING,STRING,INT
====
---- QUERY
-- Test single column range partitioning with string partition column
create table range_part_single_string_col (id int, name string, valf float,
primary key (id, name)) partition by range(name)
(partition values <= 'aaa', partition 'aaa' < values <= 'bbb',
partition 'bbb' < values <= 'ccc', partition value = 'ddd') stored as kudu
---- RESULTS
'Table has been created.'
====
---- QUERY
show table stats range_part_single_string_col
---- LABELS
# Rows,Start Key,Stop Key,Leader Replica,# Replicas
---- RESULTS
-1,'','61616100',regex:.*?:\d+,3
-1,'61616100','62626200',regex:.*?:\d+,3
-1,'62626200','63636300',regex:.*?:\d+,3
-1,'646464','64646400',regex:.*?:\d+,3
---- TYPES
INT,STRING,STRING,STRING,INT
====
---- QUERY
-- Test hash and range partitioning
create table simple_hash_range (id int, name string, valf float, vali bigint,
primary key (id, name)) partition by hash(id) partitions 4, range(id, name)
(partition value = (10, 'martin'), partition value = (20, 'alex')) stored as kudu
---- RESULTS
'Table has been created.'
====
---- QUERY
show table stats simple_hash_range
---- LABELS
# Rows,Start Key,Stop Key,Leader Replica,# Replicas
---- RESULTS
-1,'000000008000000A6D617274696E','000000008000000A6D617274696E00',regex:.*?:\d+,3
-1,'0000000080000014616C6578','0000000080000014616C657800',regex:.*?:\d+,3
-1,'000000018000000A6D617274696E','000000018000000A6D617274696E00',regex:.*?:\d+,3
-1,'0000000180000014616C6578','0000000180000014616C657800',regex:.*?:\d+,3
-1,'000000028000000A6D617274696E','000000028000000A6D617274696E00',regex:.*?:\d+,3
-1,'0000000280000014616C6578','0000000280000014616C657800',regex:.*?:\d+,3
-1,'000000038000000A6D617274696E','000000038000000A6D617274696E00',regex:.*?:\d+,3
-1,'0000000380000014616C6578','0000000380000014616C657800',regex:.*?:\d+,3
---- TYPES
INT,STRING,STRING,STRING,INT
====
---- QUERY
create table simple_hash_range_ctas
primary key (id, name) partition by hash(id) partitions 4,
range(id, name) (partition value = (10, 'casey'), partition value = (20, 'marcel'))
stored as kudu
as select * from simple_hash
---- RESULTS
'Inserted 0 row(s)'
====
---- QUERY
show table stats simple_hash_range_ctas
---- LABELS
# Rows,Start Key,Stop Key,Leader Replica,# Replicas
---- RESULTS
-1,'000000008000000A6361736579','000000008000000A636173657900',regex:.*?:\d+,3
-1,'00000000800000146D617263656C','00000000800000146D617263656C00',regex:.*?:\d+,3
-1,'000000018000000A6361736579','000000018000000A636173657900',regex:.*?:\d+,3
-1,'00000001800000146D617263656C','00000001800000146D617263656C00',regex:.*?:\d+,3
-1,'000000028000000A6361736579','000000028000000A636173657900',regex:.*?:\d+,3
-1,'00000002800000146D617263656C','00000002800000146D617263656C00',regex:.*?:\d+,3
-1,'000000038000000A6361736579','000000038000000A636173657900',regex:.*?:\d+,3
-1,'00000003800000146D617263656C','00000003800000146D617263656C00',regex:.*?:\d+,3
---- TYPES
INT,STRING,STRING,STRING,INT
====
---- QUERY
-- Test hash defaults to all columns
create table simple_hash_all_columns (id int, name string, valf float, vali bigint,
primary key (id, name)) partition by hash partitions 4 stored as kudu
---- RESULTS
'Table has been created.'
====
---- QUERY
show table stats simple_hash_all_columns
---- LABELS
# Rows,Start Key,Stop Key,Leader Replica,# Replicas
---- RESULTS
-1,'','00000001',regex:.*?:\d+,3
-1,'00000001','00000002',regex:.*?:\d+,3
-1,'00000002','00000003',regex:.*?:\d+,3
-1,'00000003','',regex:.*?:\d+,3
---- TYPES
INT,STRING,STRING,STRING,INT
====
---- QUERY
-- Test range defaults to all columns
create table simple_range_all_columns (id int, name string, valf float, vali bigint,
primary key (id, name)) partition by range
(partition value = (1, 'a'), partition value = (2, 'b'))
stored as kudu
---- RESULTS
'Table has been created.'
====
---- QUERY
show table stats simple_range_all_columns
---- LABELS
# Rows,Start Key,Stop Key,Leader Replica,# Replicas
---- RESULTS
-1,'8000000161','800000016100',regex:.*?:\d+,3
-1,'8000000262','800000026200',regex:.*?:\d+,3
---- TYPES
INT,STRING,STRING,STRING,INT
====
---- QUERY
-- Test using non-literal constant values in range-partition bounds
create table range_complex_const_boundary_vals (x int, y int, primary key (x))
partition by range (x) (partition values < 1 + 1, partition (1+3) + 2 < values < 10,
partition factorial(4) < values < factorial(5), partition value = factorial(6))
stored as kudu
---- RESULTS
'Table has been created.'
====
---- QUERY
show table stats range_complex_const_boundary_vals
---- LABELS
# Rows,Start Key,Stop Key,Leader Replica,# Replicas
---- RESULTS
-1,'','80000002',regex:.*?:\d+,3
-1,'80000007','8000000A',regex:.*?:\d+,3
-1,'80000019','80000078',regex:.*?:\d+,3
-1,'800002D0','800002D1',regex:.*?:\d+,3
---- TYPES
INT,STRING,STRING,STRING,INT
====
---- QUERY
-- Test range partitioning with overlapping partitions
create table simple_range_with_overlapping (id int, name string, valf float, vali bigint,
primary key (id, name)) partition by range (id)
(partition values <= 10, partition values < 20, partition value = 5) stored as kudu
---- CATCH
NonRecoverableException: overlapping range partitions: first range partition: VALUES < 11, second range partition: VALUES < 20
====
---- QUERY
-- Test range partitioning with the same partition specified multiple times
create table simple_range_duplicate_parts (id int, name string, valf float, vali bigint,
primary key(id, name)) partition by range (id)
(partition 10 < values <= 20, partition 10 < values <= 20) stored as kudu
---- CATCH
NonRecoverableException: overlapping range partitions: first range partition: 11 <= VALUES < 21, second range partition: 11 <= VALUES < 21
====
---- QUERY
-- Test multi-column range partitioning with the same partition specified multiple times
create table range_multi_col_duplicate_parts (id int, name string, valf float,
vali bigint, primary key (id, name)) partition by range (id, name)
(partition value = (10, 'dimitris'), partition value = (10, 'dimitris')) stored as kudu
---- CATCH
NonRecoverableException: overlapping range partitions: first range partition: (10, "dimitris") <= VALUES < (10, "dimitris\000"), second range partition: (10, "dimitris") <= VALUES < (10, "dimitris\000")
====