Files
impala/testdata/workloads/functional-query/queries/QueryTest/create_kudu.test
Matthew Jacobs d113205cee IMPALA-3650: DISTRIBUTE BY required for managed Kudu tables
As of Kudu 0.9, DISTRIBUTE BY is now required when creating
a new Kudu table. Create table analysis, data loading, and
tests are updated to reflect this.

This also bumps the Kudu version to 0.10.0.

Change-Id: Ieb15110b10b28ef6dd8ec136c2522b5f44dca43e
Reviewed-on: http://gerrit.cloudera.org:8080/3987
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: Internal Jenkins
2016-08-19 02:14:39 +00:00

91 lines
2.2 KiB
Plaintext

====
---- QUERY
# Create managed Kudu table
create table managed_kudu
( id int, f float, d double, s string, v varchar(10), t tinyint, m smallint )
distribute by hash into 3 buckets
tblproperties
(
'storage_handler' = 'com.cloudera.kudu.hive.KuduStorageHandler',
'kudu.table_name' = 'managed_kudu',
'kudu.master_addresses' = '0.0.0.0:7051',
'kudu.key_columns' = 'id'
)
---- RESULTS
====
---- QUERY
describe managed_kudu
---- RESULTS
'id','int',''
'f','float',''
'd','double',''
's','string',''
'v','varchar(10)',''
't','tinyint',''
'm','smallint',''
---- TYPES
STRING,STRING,STRING
====
---- QUERY
# Create external kudu table with non-matching schema (name)
create external table external_kudu
( id int, f float, do double, s string, v varchar(10), t tinyint, m smallint )
tblproperties
(
'storage_handler' = 'com.cloudera.kudu.hive.KuduStorageHandler',
'kudu.table_name' = 'managed_kudu',
'kudu.master_addresses' = '0.0.0.0:7051',
'kudu.key_columns' = 'id'
)
---- CATCH
ImpalaRuntimeException: Table external_kudu (managed_kudu) has a different schema in Kudu than in Hive.
====
---- QUERY
# Create external kudu table with non-matching schema (type)
create external table external_kudu
( id bigint, f float, d double, s string, v varchar(10), t tinyint, m smallint )
tblproperties
(
'storage_handler' = 'com.cloudera.kudu.hive.KuduStorageHandler',
'kudu.table_name' = 'managed_kudu',
'kudu.master_addresses' = '0.0.0.0:7051',
'kudu.key_columns' = 'id'
)
---- CATCH
ImpalaRuntimeException: Table external_kudu (managed_kudu) has a different schema in Kudu than in Hive.
====
---- QUERY
# Create external kudu table with matching schema
create external table external_kudu
( id int, f float, d double, s string, v varchar(10), t tinyint, m smallint )
tblproperties
(
'storage_handler' = 'com.cloudera.kudu.hive.KuduStorageHandler',
'kudu.table_name' = 'managed_kudu',
'kudu.master_addresses' = '0.0.0.0:7051',
'kudu.key_columns' = 'id'
)
---- RESULTS
====
---- QUERY
describe external_kudu
---- RESULTS
'id','int',''
'f','float',''
'd','double',''
's','string',''
'v','varchar(10)',''
't','tinyint',''
'm','smallint',''
---- TYPES
STRING,STRING,STRING
====
---- QUERY
drop table external_kudu
---- RESULTS
=====
---- QUERY
drop table managed_kudu
---- RESULTS
=====