==== ---- QUERY drop table if exists ddl_test_db.temp_legacy_table ---- RESULTS ==== ---- QUERY create table ddl_test_db.temp_legacy_table like parquet '$FILESYSTEM_PREFIX/test-warehouse/schemas/legacy_nested.parquet' ---- RESULTS ==== ---- QUERY describe ddl_test_db.temp_legacy_table ---- RESULTS 't_long','bigint','Inferred from Parquet file.' 't_struct','struct<\n f_int:int,\n t_struct:struct<\n f_int:int,\n f_int2:int\n >,\n int_arr:array,\n int_map:map\n>','Inferred from Parquet file.' 't_array_basic','array','Inferred from Parquet file.' 't_array_struct','array>','Inferred from Parquet file.' 't_array_array','array>','Inferred from Parquet file.' 't_array_map','array>','Inferred from Parquet file.' 'map_int','map','Inferred from Parquet file.' 'map_struct','map>','Inferred from Parquet file.' 'map_array','map>','Inferred from Parquet file.' 'map_map','map>','Inferred from Parquet file.' ---- TYPES STRING, STRING, STRING ==== ---- QUERY drop table if exists ddl_test_db.temp_legacy_table ---- RESULTS ==== ---- QUERY drop table if exists ddl_test_db.temp_modern_table ---- RESULTS ==== ---- QUERY create table ddl_test_db.temp_modern_table like parquet '$FILESYSTEM_PREFIX/test-warehouse/schemas/modern_nested.parquet' ---- RESULTS ==== ---- QUERY describe ddl_test_db.temp_modern_table ---- RESULTS 't_long','bigint','Inferred from Parquet file.' 't_struct','struct<\n f_int:int,\n t_struct:struct<\n f_int:int,\n f_int2:int\n >,\n int_arr:array,\n int_map:map\n>','Inferred from Parquet file.' 't_array_basic','array','Inferred from Parquet file.' 't_array_struct','array>','Inferred from Parquet file.' 't_array_array','array>','Inferred from Parquet file.' 't_array_map','array>','Inferred from Parquet file.' 'map_int','map','Inferred from Parquet file.' 'map_struct','map>','Inferred from Parquet file.' 'map_array','map>','Inferred from Parquet file.' 'map_map','map>','Inferred from Parquet file.' ---- TYPES STRING, STRING, STRING ==== ---- QUERY drop table if exists ddl_test_db.temp_modern_table ---- RESULTS ==== ---- QUERY drop table if exists allcomplextypes_clone ---- RESULTS ==== ---- QUERY create table allcomplextypes_clone like functional.allcomplextypes stored as parquet ---- RESULTS ==== ---- QUERY describe allcomplextypes_clone ---- RESULTS 'id','int','' 'int_array_col','array','' 'array_array_col','array>','' 'map_array_col','array>','' 'struct_array_col','array>','' 'int_map_col','map','' 'array_map_col','map>','' 'map_map_col','map>','' 'struct_map_col','map>','' 'int_struct_col','struct<\n f1:int,\n f2:int\n>','' 'complex_struct_col','struct<\n f1:int,\n f2:array,\n f3:map\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>\n >>\n>','' 'year','int','' 'month','int','' ---- TYPES STRING, STRING, STRING ==== ---- QUERY drop table allcomplextypes_clone ---- RESULTS ==== ---- QUERY # IMPALA-2820: Test keywords as struct-field names. All field names below are # Impala keywords, but only some of them are quoted to show that a mix of # quoted/unquoted identifiers is possible. create table ddl_test_db.struct_keywords ( s struct, a array>, m map> ) partitioned by (year int, month int); describe ddl_test_db.struct_keywords; ---- RESULTS 's','struct<\n table:int,\n comment:string,\n select:decimal(8,2)\n>','' 'a','array>','' 'm','map>','' 'year','int','' 'month','int','' ---- TYPES STRING, STRING, STRING ==== ---- QUERY # Test creating a partitioned Avro table without an Avro schema. # The Avro schema is inferred from the column definitions. create table no_avro_schema ( c1 tinyint, c2 smallint comment 'becomes int', c3 int, c4 bigint, c5 float, c6 double, c7 timestamp comment 'becomes string', c8 string, c9 char(10) comment 'preserved', c10 varchar(20), c11 decimal(10, 5), c12 struct, c13 array, c14 map) partitioned by (year int, month int) stored as avro ---- RESULTS ==== ---- QUERY describe no_avro_schema ---- RESULTS 'c1','int','from deserializer' 'c2','int','becomes int' 'c3','int','from deserializer' 'c4','bigint','from deserializer' 'c5','float','from deserializer' 'c6','double','from deserializer' 'c7','string','becomes string' 'c8','string','from deserializer' 'c9','char(10)','preserved' 'c10','varchar(20)','from deserializer' 'c11','decimal(10,5)','from deserializer' 'c12','struct<\n f1:int,\n f2:string\n>','from deserializer' 'c13','array','from deserializer' 'c14','map','from deserializer' 'year','int','' 'month','int','' ---- TYPES STRING, STRING, STRING ==== ---- QUERY # Test creating an Avro table without an Avro schema via CREATE TABLE LIKE (IMPALA-1813) create table like_no_avro_schema like no_avro_schema stored as avro ---- RESULTS ==== ---- QUERY describe like_no_avro_schema ---- RESULTS 'c1','int','from deserializer' 'c2','int','becomes int' 'c3','int','from deserializer' 'c4','bigint','from deserializer' 'c5','float','from deserializer' 'c6','double','from deserializer' 'c7','string','becomes string' 'c8','string','from deserializer' 'c9','char(10)','preserved' 'c10','varchar(20)','from deserializer' 'c11','decimal(10,5)','from deserializer' 'c12','struct<\n f1:int,\n f2:string\n>','from deserializer' 'c13','array','from deserializer' 'c14','map','from deserializer' 'year','int','' 'month','int','' ---- TYPES STRING, STRING, STRING ==== ---- QUERY drop table like_no_avro_schema ---- RESULTS ==== ---- QUERY drop table no_avro_schema ---- RESULTS ==== ---- QUERY select s.`table`, s.`comment`, s.`select`, a.`replace`, a.`location`, m.key, m.`fields`, m.`from`, year, month from ddl_test_db.struct_keywords t, t.a, t.m ---- RESULTS ---- TYPES INT, STRING, DECIMAL, BOOLEAN, STRING, STRING, INT, TIMESTAMP, INT, INT ====