mirror of
https://github.com/apache/impala.git
synced 2026-01-08 12:02:54 -05:00
Describe should work if given a path that references to a complex-typed column of a table. It should produce output that lists the names and types of all valid subpaths of the column (e.g. struct fields, or key/val for a map). This changes some error messages in resolving paths, since we can no longer definitively determine based on the path length whether the first path element is meant to be the db or the table. Change-Id: I8a54e83df67141011ff5396c98f9eb0bde0fb04c Reviewed-on: http://gerrit.cloudera.org:8080/863 Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com> Tested-by: Internal Jenkins
132 lines
3.1 KiB
Plaintext
132 lines
3.1 KiB
Plaintext
====
|
|
---- QUERY
|
|
# Simple describe (note Hive does not support this)
|
|
describe functional.alltypes
|
|
---- RESULTS
|
|
'id','int','Add a comment'
|
|
'bool_col','boolean',''
|
|
'tinyint_col','tinyint',''
|
|
'smallint_col','smallint',''
|
|
'int_col','int',''
|
|
'bigint_col','bigint',''
|
|
'float_col','float',''
|
|
'double_col','double',''
|
|
'date_string_col','string',''
|
|
'string_col','string',''
|
|
'timestamp_col','timestamp',''
|
|
'year','int',''
|
|
'month','int',''
|
|
---- TYPES
|
|
string, string, string
|
|
====
|
|
---- QUERY
|
|
USE functional
|
|
====
|
|
---- QUERY
|
|
# Default database
|
|
describe alltypes
|
|
---- RESULTS
|
|
'id','int','Add a comment'
|
|
'bool_col','boolean',''
|
|
'tinyint_col','tinyint',''
|
|
'smallint_col','smallint',''
|
|
'int_col','int',''
|
|
'bigint_col','bigint',''
|
|
'float_col','float',''
|
|
'double_col','double',''
|
|
'date_string_col','string',''
|
|
'string_col','string',''
|
|
'timestamp_col','timestamp',''
|
|
'year','int',''
|
|
'month','int',''
|
|
---- TYPES
|
|
string, string, string
|
|
====
|
|
---- QUERY
|
|
# Test printing of complex types.
|
|
describe functional.allcomplextypes
|
|
---- RESULTS
|
|
'id','int',''
|
|
'int_array_col','array<int>',''
|
|
'array_array_col','array<array<int>>',''
|
|
'map_array_col','array<map<string,int>>',''
|
|
'struct_array_col','array<struct<\n f1:bigint,\n f2:string\n>>',''
|
|
'int_map_col','map<string,int>',''
|
|
'array_map_col','map<string,array<int>>',''
|
|
'map_map_col','map<string,map<string,int>>',''
|
|
'struct_map_col','map<string,struct<\n f1:bigint,\n f2:string\n>>',''
|
|
'int_struct_col','struct<\n f1:int,\n f2:int\n>',''
|
|
'complex_struct_col','struct<\n f1:int,\n f2:array<int>,\n f3:map<string,int>\n>',''
|
|
'nested_struct_col','struct<\n f1:int,\n f2:struct<\n f11:bigint,\n f12:struct<\n f21:bigint\n >\n >\n>',''
|
|
'complex_nested_struct_col','struct<\n f1:int,\n f2:array<struct<\n f11:bigint,\n f12:map<string,struct<\n f21:bigint\n >>\n >>\n>',''
|
|
'year','int',''
|
|
'month','int',''
|
|
---- TYPES
|
|
string, string, string
|
|
====
|
|
---- QUERY
|
|
describe functional_parquet.allcomplextypes.int_array_col
|
|
---- RESULTS
|
|
'item','int',''
|
|
'pos','bigint',''
|
|
---- TYPES
|
|
string,string,string
|
|
====
|
|
---- QUERY
|
|
describe functional_parquet.allcomplextypes.map_array_col.item
|
|
---- RESULTS
|
|
'key','string',''
|
|
'value','int',''
|
|
---- TYPES
|
|
string,string,string
|
|
====
|
|
---- QUERY
|
|
describe functional_parquet.allcomplextypes.complex_struct_col
|
|
---- RESULTS
|
|
'f1','int',''
|
|
'f2','array<int>',''
|
|
'f3','map<string,int>',''
|
|
---- TYPES
|
|
string,string,string
|
|
====
|
|
---- QUERY
|
|
describe functional_parquet.allcomplextypes.complex_struct_col.f2
|
|
---- RESULTS
|
|
'item','int',''
|
|
'pos','bigint',''
|
|
---- TYPES
|
|
string,string,string
|
|
====
|
|
---- QUERY
|
|
use functional_parquet
|
|
====
|
|
---- QUERY
|
|
describe functional_parquet.allcomplextypes.complex_struct_col.f2
|
|
---- RESULTS
|
|
'item','int',''
|
|
'pos','bigint',''
|
|
---- TYPES
|
|
string,string,string
|
|
====
|
|
---- QUERY
|
|
use functional_parquet
|
|
====
|
|
---- QUERY
|
|
# Check that paths relative to current database work ok.
|
|
describe allcomplextypes.int_array_col
|
|
---- RESULTS
|
|
'item','int',''
|
|
'pos','bigint',''
|
|
---- TYPES
|
|
string,string,string
|
|
====
|
|
---- QUERY
|
|
# Pretty-printing should work for fields too.
|
|
describe allcomplextypes.nested_struct_col
|
|
---- RESULTS
|
|
'f1','int',''
|
|
'f2','struct<\n f11:bigint,\n f12:struct<\n f21:bigint\n >\n>',''
|
|
---- TYPES
|
|
string,string,string
|
|
====
|