mirror of
https://github.com/apache/impala.git
synced 2026-01-03 15:00:52 -05:00
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
91 lines
2.2 KiB
Plaintext
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
|
|
=====
|