Files
impala/testdata/workloads/functional-query/queries/QueryTest/kudu_describe.test
Matthew Jacobs a16a0fa84d IMPALA-5137: Support Kudu UNIXTIME_MICROS as Impala TIMESTAMP
Adds Impala support for TIMESTAMP types stored in Kudu.

Impala stores TIMESTAMP values in 96-bits and has nanosecond
precision. Kudu's timestamp is a 64-bit microsecond delta
from the Unix epoch (called UNIXTIME_MICROS), so a conversion
is necessary.

When writing to Kudu, TIMESTAMP values in nanoseconds are
averaged to the nearest microsecond.

When reading from Kudu, the KuduScanner returns
UNIXTIME_MICROS with 8bytes of padding so Impala can convert
the value to a TimestampValue in-line and copy the entire
row.

Testing:
Updated the functional_kudu schema to use TIMESTAMPs instead
of converting to STRING, so this provides some decent
coverage. Some BE tests were added, and some EE tests as
well.

TODO: Support pushing down TIMESTAMP predicates
TODO: Support TIMESTAMPs in range partitioning expressions

Change-Id: Iae6ccfffb79118a9036fb2227dba3a55356c896d
Reviewed-on: http://gerrit.cloudera.org:8080/6526
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: Impala Public Jenkins
2017-05-11 20:55:51 +00:00

48 lines
2.3 KiB
Plaintext

====
---- QUERY
describe functional_kudu.alltypes
---- LABELS
NAME,TYPE,COMMENT,PRIMARY_KEY,NULLABLE,DEFAULT_VALUE,ENCODING,COMPRESSION,BLOCK_SIZE
---- RESULTS
'bigint_col','bigint','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'bool_col','boolean','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'date_string_col','string','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'double_col','double','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'float_col','float','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'id','int','','true','false','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'int_col','int','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'month','int','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'smallint_col','smallint','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'string_col','string','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'timestamp_col','timestamp','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'tinyint_col','tinyint','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'year','int','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
---- TYPES
STRING,STRING,STRING,STRING,STRING,STRING,STRING,STRING,STRING
====
---- QUERY
# Test composite primary key and column options.
create table describe_test
(pk1 int,
pk2 int,
pk3 string,
c1 string null default 'abc' comment 'testing',
c2 int not null default 100 encoding plain_encoding compression snappy,
c3 int null block_size 8388608,
primary key (pk1, pk2, pk3))
partition by hash (pk1) partitions 3
stored as kudu;
describe describe_test;
---- LABELS
NAME,TYPE,COMMENT,PRIMARY_KEY,NULLABLE,DEFAULT_VALUE,ENCODING,COMPRESSION,BLOCK_SIZE
---- RESULTS
'pk1','int','','true','false','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'pk2','int','','true','false','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'pk3','string','','true','false','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'c1','string','','false','true','abc','AUTO_ENCODING','DEFAULT_COMPRESSION','0'
'c2','int','','false','false','100','PLAIN_ENCODING','SNAPPY','0'
'c3','int','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','8388608'
---- TYPES
STRING,STRING,STRING,STRING,STRING,STRING,STRING,STRING,STRING
====