impala-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tarmstr...@apache.org
Subject [2/2] incubator-impala git commit: IMPALA-3530: Clean up test_ddl.py. Part 1.
Date Fri, 10 Jun 2016 17:31:21 GMT
IMPALA-3530: Clean up test_ddl.py. Part 1.

This is the first in a series of patches to clean up test_ddl.py

Summary of changes:
  - Break up test_create() and corresponding .test files into:
    * test_create_database()
    * test_create_table()
    * test_create_table_like_table()
    * test_create_table_like_file()
    * test_create_table_as_select()
  - Merge test_nested() into the tests above
  - Move a test into test_hms_integration.py
  - Add a new test_ddl_base.py as base class for DDL tests.
    The plan is to split up test_ddl.py into several smaller
    .py files in subsequent patches.

Testing: I tested test_ddl.py and test_hms_integration.py on
exhaustive locally as well as in private builds on all filesystems.

Change-Id: I5f4c044d39e165c2535961b8d0a765c8dbbd051c
Reviewed-on: http://gerrit.cloudera.org:8080/3044
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: Alex Behm <alex.behm@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/19ff4709
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/19ff4709
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/19ff4709

Branch: refs/heads/master
Commit: 19ff47091cad90fe2975a696d287a863e47f877f
Parents: ca62ce6
Author: Alex Behm <alex.behm@cloudera.com>
Authored: Tue May 10 10:46:13 2016 -0700
Committer: Tim Armstrong <tarmstrong@cloudera.com>
Committed: Fri Jun 10 10:31:15 2016 -0700

----------------------------------------------------------------------
 .../queries/QueryTest/create-database.test      | 113 +++
 .../queries/QueryTest/create-nested.test        | 203 -----
 .../QueryTest/create-table-as-select.test       | 189 +++++
 .../QueryTest/create-table-like-file.test       | 170 ++++
 .../QueryTest/create-table-like-table.test      | 215 +++++
 .../queries/QueryTest/create-table.test         | 296 +++++++
 .../queries/QueryTest/create.test               | 816 -------------------
 tests/metadata/test_ddl.py                      | 205 +----
 tests/metadata/test_ddl_base.py                 | 105 +++
 tests/metadata/test_hms_integration.py          |  50 +-
 10 files changed, 1180 insertions(+), 1182 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/19ff4709/testdata/workloads/functional-query/queries/QueryTest/create-database.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-query/queries/QueryTest/create-database.test b/testdata/workloads/functional-query/queries/QueryTest/create-database.test
new file mode 100644
index 0000000..d2dc7c4
--- /dev/null
+++ b/testdata/workloads/functional-query/queries/QueryTest/create-database.test
@@ -0,0 +1,113 @@
+====
+---- QUERY
+create database create_db_test comment "For testing"
+---- RESULTS
+====
+---- QUERY
+show databases like "create_db_test"
+---- RESULTS
+'create_db_test','For testing'
+---- TYPES
+STRING, STRING
+====
+---- QUERY
+# Make sure creating a database with the same name doesn't throw an error when
+# IF NOT EXISTS is specified.
+create database if not exists create_db_test
+---- RESULTS
+====
+---- QUERY
+# Test dropping the database.
+drop database create_db_test
+---- RESULTS
+====
+---- QUERY
+show databases like "create_db_test"
+---- RESULTS
+---- TYPES
+STRING, STRING
+====
+---- QUERY
+# Dropping a non-existent databases is ok with IF EXISTS
+drop database if exists create_db_test
+---- RESULTS
+====
+---- QUERY
+# Test DROP DATABASE ... CASCADE
+create database if not exists test_drop_cascade_db
+====
+---- QUERY
+show databases like 'test_drop_cascade_db'
+---- RESULTS
+'test_drop_cascade_db',''
+---- TYPES
+STRING,STRING
+====
+---- QUERY
+create table if not exists test_drop_cascade_db.t1 (i int);
+create table if not exists test_drop_cascade_db.t2 (i int)
+  partitioned by (year smallint, month smallint);
+insert into test_drop_cascade_db.t2 partition (year=2015, month=8) values(1);
+create external table if not exists test_drop_cascade_db.t3 like functional.alltypes
+  location '$FILESYSTEM_PREFIX/test-warehouse/alltypes_external';
+create view if not exists test_drop_cascade_db.v1 as
+  select int_col from functional.alltypes;
+create function if not exists test_drop_cascade_db.f1() returns string
+  location '$FILESYSTEM_PREFIX/test-warehouse/libTestUdfs.so' symbol='NoArgs';
+create aggregate function if not exists test_drop_cascade_db.f2(int, string) RETURNS int
+  location '$FILESYSTEM_PREFIX/test-warehouse/libTestUdas.so' UPDATE_FN='TwoArgUpdate'
+---- RESULTS
+====
+---- QUERY
+show tables in test_drop_cascade_db
+---- RESULTS
+'t1'
+'t2'
+'t3'
+'v1'
+---- TYPES
+STRING
+====
+---- QUERY
+show functions in test_drop_cascade_db
+---- RESULTS
+'STRING','f1()','NATIVE','true'
+---- TYPES
+STRING, STRING, STRING, STRING
+====
+---- QUERY
+show aggregate functions in test_drop_cascade_db
+---- RESULTS
+'INT','f2(INT, STRING)','NATIVE','true'
+---- TYPES
+STRING, STRING, STRING, STRING
+====
+---- QUERY
+# Should drop all tables, functions, and aggregate functions, as well
+# as the database itself.
+drop database test_drop_cascade_db cascade
+---- RESULTS
+====
+---- QUERY
+show databases like 'test_drop_cascade_db'
+---- RESULTS
+====
+---- QUERY
+# Test that DROP DATABASE ... RESTRICT executes ok.
+create database if not exists test_drop_restrict_db
+====
+---- QUERY
+show databases like 'test_drop_restrict_db'
+---- RESULTS
+'test_drop_restrict_db',''
+---- TYPES
+STRING,STRING
+====
+---- QUERY
+drop database test_drop_restrict_db restrict
+---- RESULTS
+====
+---- QUERY
+show databases like 'test_drop_restrict_db'
+---- RESULTS
+====

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/19ff4709/testdata/workloads/functional-query/queries/QueryTest/create-nested.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-query/queries/QueryTest/create-nested.test b/testdata/workloads/functional-query/queries/QueryTest/create-nested.test
deleted file mode 100644
index 281cb96..0000000
--- a/testdata/workloads/functional-query/queries/QueryTest/create-nested.test
+++ /dev/null
@@ -1,203 +0,0 @@
-====
----- 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<int>,\n  int_map:map<string,int>\n>','Inferred from Parquet file.'
-'t_array_basic','array<int>','Inferred from Parquet file.'
-'t_array_struct','array<struct<\n  f_int1:int,\n  f_int2:int,\n  f_int3:int\n>>','Inferred from Parquet file.'
-'t_array_array','array<array<int>>','Inferred from Parquet file.'
-'t_array_map','array<map<string,int>>','Inferred from Parquet file.'
-'map_int','map<string,int>','Inferred from Parquet file.'
-'map_struct','map<string,struct<\n  f_int:int,\n  f_int2:int\n>>','Inferred from Parquet file.'
-'map_array','map<string,array<int>>','Inferred from Parquet file.'
-'map_map','map<string,map<string,int>>','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<int>,\n  int_map:map<string,int>\n>','Inferred from Parquet file.'
-'t_array_basic','array<int>','Inferred from Parquet file.'
-'t_array_struct','array<struct<\n  f_int1:int,\n  f_int2:int,\n  f_int3:int\n>>','Inferred from Parquet file.'
-'t_array_array','array<array<int>>','Inferred from Parquet file.'
-'t_array_map','array<map<string,int>>','Inferred from Parquet file.'
-'map_int','map<string,int>','Inferred from Parquet file.'
-'map_struct','map<string,struct<\n  f_int:int,\n  f_int2:int\n>>','Inferred from Parquet file.'
-'map_array','map<string,array<int>>','Inferred from Parquet file.'
-'map_map','map<string,map<string,int>>','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<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
-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<table:int,`comment`:string,`select`:decimal(8,2)>,
-  a array<struct<`replace`:boolean,`location`:varchar(10)>>,
-  m map<string,struct<`fields`:int,from:timestamp>>
-)
-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<struct<\n  replace:boolean,\n  location:varchar(10)\n>>',''
-'m','map<string,struct<\n  fields:int,\n  from:timestamp\n>>',''
-'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<f1:int,f2:string>,
-  c13 array<int>,
-  c14 map<string,string>)
-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<int>','from deserializer'
-'c14','map<string,string>','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<int>','from deserializer'
-'c14','map<string,string>','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
-====

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/19ff4709/testdata/workloads/functional-query/queries/QueryTest/create-table-as-select.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-query/queries/QueryTest/create-table-as-select.test b/testdata/workloads/functional-query/queries/QueryTest/create-table-as-select.test
new file mode 100644
index 0000000..4c626de
--- /dev/null
+++ b/testdata/workloads/functional-query/queries/QueryTest/create-table-as-select.test
@@ -0,0 +1,189 @@
+====
+---- QUERY
+# Ensure that a table can be created using CTAS
+create table ctas_join stored as parquet as
+select j.*, a.int_col, 1*2
+from functional.jointbl j join functional_seq_snap.alltypes a
+  on (j.alltypes_id=a.id)
+---- RESULTS
+'Inserted 12 row(s)'
+---- TYPES
+STRING
+====
+---- QUERY
+describe ctas_join
+---- RESULTS
+'test_id','bigint',''
+'test_name','string',''
+'test_zip','int',''
+'alltypes_id','int',''
+'int_col','int',''
+'_c2','smallint',''
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+select * from ctas_join
+---- RESULTS
+1001,'Name1',94611,5000,0,2
+1002,'Name2',94611,5000,0,2
+1003,'Name3',94611,5000,0,2
+1004,'Name4',94611,5000,0,2
+1005,'Name5',94611,5000,0,2
+1106,'Name6',94612,5000,0,2
+1006,'Name16',94612,5000,0,2
+1006,'Name6',94616,5000,0,2
+1106,'Name16',94612,5000,0,2
+1106,'Name6',94616,5000,0,2
+1006,'Name16',94616,5000,0,2
+1106,'Name16',94616,5000,0,2
+---- TYPES
+BIGINT, STRING, INT, INT, INT, SMALLINT
+====
+---- QUERY
+# Since the table already exists, the second CTAS should be a no-op
+create table if not exists ctas_join stored as parquet as
+select j.*, a.int_col, 1*2
+from functional.jointbl j join functional_seq_snap.alltypes a
+  on (j.alltypes_id=a.id) limit 1
+---- RESULTS
+'Inserted 0 row(s)'
+---- TYPES
+STRING
+====
+---- QUERY
+select * from ctas_join
+---- RESULTS
+1001,'Name1',94611,5000,0,2
+1002,'Name2',94611,5000,0,2
+1003,'Name3',94611,5000,0,2
+1004,'Name4',94611,5000,0,2
+1005,'Name5',94611,5000,0,2
+1106,'Name6',94612,5000,0,2
+1006,'Name16',94612,5000,0,2
+1006,'Name6',94616,5000,0,2
+1106,'Name16',94612,5000,0,2
+1106,'Name6',94616,5000,0,2
+1006,'Name16',94616,5000,0,2
+1106,'Name16',94616,5000,0,2
+---- TYPES
+BIGINT, STRING, INT, INT, INT, SMALLINT
+====
+---- QUERY
+# Validate CTAS with LIMIT 0
+create table if not exists ctas_join_limit0 stored as textfile as
+select * from functional.jointbl limit 0
+---- RESULTS
+'Inserted 0 row(s)'
+---- TYPES
+STRING
+====
+---- QUERY
+describe ctas_join_limit0
+---- RESULTS
+'test_id','bigint',''
+'test_name','string',''
+'test_zip','int',''
+'alltypes_id','int',''
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+select * from ctas_join_limit0
+---- RESULTS
+---- TYPES
+BIGINT, STRING, INT, INT
+====
+---- QUERY
+# Validate CTAS with LIMIT 0 and IF NOT EXISTS when the target
+# table already exists.
+create table if not exists ctas_join_limit0 stored as textfile as
+select * from functional.jointbl limit 0
+---- RESULTS
+'Inserted 0 row(s)'
+---- TYPES
+STRING
+====
+---- QUERY
+select * from ctas_join_limit0
+---- RESULTS
+---- TYPES
+BIGINT, STRING, INT, INT
+====
+---- QUERY
+create table if not exists ctas_join_limit0 stored as textfile as
+select * from functional.jointbl limit 4
+---- RESULTS
+'Inserted 0 row(s)'
+---- TYPES
+STRING
+====
+---- QUERY
+select * from ctas_join_limit0
+---- RESULTS
+---- TYPES
+BIGINT, STRING, INT, INT
+====
+---- QUERY
+# IMPALA-2203: Test CTAS from a select statement that has outer-joined inline views with
+# constant exprs in the select list. The non-matches of the outer join should be NULL.
+create table ctas_impala_2203 as
+select a.id, a.bool_col, a.tinyint_col, a.smallint_col, a.int_col, a.bigint_col,
+  b.float_col, b.double_col, b.date_string_col, b.string_col, b.timestamp_col
+from
+(select id, false bool_col, 1 tinyint_col, 2 smallint_col, 3 int_col, 4 bigint_col
+ from functional.alltypestiny where id between 0 and 2) a
+full outer join
+(select id, 5 float_col, 6 double_col, "s1" date_string_col, "s2" string_col,
+   cast("2009-02-06 00:01:00" as timestamp) timestamp_col
+ from functional.alltypestiny where id between 1 and 3) b
+on (a.id = b.id)
+---- RESULTS
+'Inserted 4 row(s)'
+---- TYPES
+STRING
+====
+---- QUERY
+select * from ctas_impala_2203
+---- RESULTS: VERIFY_IS_EQUAL_SORTED
+0,false,1,2,3,4,NULL,NULL,'NULL','NULL',NULL
+1,false,1,2,3,4,5,6,'s1','s2',2009-02-06 00:01:00
+2,false,1,2,3,4,5,6,'s1','s2',2009-02-06 00:01:00
+NULL,NULL,NULL,NULL,NULL,NULL,5,6,'s1','s2',2009-02-06 00:01:00
+---- TYPES
+INT, BOOLEAN, TINYINT, TINYINT, TINYINT, TINYINT, TINYINT, TINYINT, STRING, STRING, TIMESTAMP
+====
+---- QUERY
+# Test creating a partitioned Parquet table with CTAS.
+create table ddl_test_db.ctas_part_alltypestiny
+partitioned by (year,month) stored as parquet
+as select * from functional.alltypestiny
+---- RESULTS
+'Inserted 8 row(s)'
+====
+---- QUERY
+select id, float_col, timestamp_col, string_col, year, month
+from ddl_test_db.ctas_part_alltypestiny
+---- RESULTS
+0,0,2009-01-01 00:00:00,'0',2009,1
+1,1.100000023841858,2009-01-01 00:01:00,'1',2009,1
+2,0,2009-02-01 00:00:00,'0',2009,2
+3,1.100000023841858,2009-02-01 00:01:00,'1',2009,2
+4,0,2009-03-01 00:00:00,'0',2009,3
+5,1.100000023841858,2009-03-01 00:01:00,'1',2009,3
+6,0,2009-04-01 00:00:00,'0',2009,4
+7,1.100000023841858,2009-04-01 00:01:00,'1',2009,4
+---- TYPES
+INT,FLOAT,TIMESTAMP,STRING,INT,INT
+====
+---- QUERY
+# IMPALA-2711: Make sure no memory leak from Rand().
+create table ddl_test_db.rand_ctas as select rand() from functional.alltypes;
+---- RESULTS
+'Inserted 7300 row(s)'
+---- ERRORS
+====
+---- QUERY
+drop table if exists ddl_test_db.rand_ctas;
+---- RESULTS
+====
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/19ff4709/testdata/workloads/functional-query/queries/QueryTest/create-table-like-file.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-query/queries/QueryTest/create-table-like-file.test b/testdata/workloads/functional-query/queries/QueryTest/create-table-like-file.test
new file mode 100644
index 0000000..79d16cc
--- /dev/null
+++ b/testdata/workloads/functional-query/queries/QueryTest/create-table-like-file.test
@@ -0,0 +1,170 @@
+====
+---- QUERY
+create table ddl_test_db.temp_decimal_table like parquet
+'$FILESYSTEM_PREFIX/test-warehouse/schemas/decimal.parquet'
+---- RESULTS
+====
+---- QUERY
+describe ddl_test_db.temp_decimal_table
+---- RESULTS
+'d32','decimal(3,2)','Inferred from Parquet file.'
+'d11','decimal(1,1)','Inferred from Parquet file.'
+'d1015','decimal(15,10)','Inferred from Parquet file.'
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+create table ddl_test_db.like_zipcodes_file like parquet
+'$FILESYSTEM_PREFIX/test-warehouse/schemas/zipcode_incomes.parquet'
+---- RESULTS
+====
+---- QUERY
+describe ddl_test_db.like_zipcodes_file
+---- RESULTS
+'id','string','Inferred from Parquet file.'
+'zip','string','Inferred from Parquet file.'
+'description1','string','Inferred from Parquet file.'
+'description2','string','Inferred from Parquet file.'
+'income','int','Inferred from Parquet file.'
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+create table ddl_test_db.like_alltypestiny_file like parquet
+'$FILESYSTEM_PREFIX/test-warehouse/schemas/alltypestiny.parquet'
+---- RESULTS
+====
+---- QUERY
+describe ddl_test_db.like_alltypestiny_file
+---- RESULTS
+'id','int','Inferred from Parquet file.'
+'bool_col','boolean','Inferred from Parquet file.'
+'tinyint_col','int','Inferred from Parquet file.'
+'smallint_col','int','Inferred from Parquet file.'
+'int_col','int','Inferred from Parquet file.'
+'bigint_col','bigint','Inferred from Parquet file.'
+'float_col','float','Inferred from Parquet file.'
+'double_col','double','Inferred from Parquet file.'
+'date_string_col','string','Inferred from Parquet file.'
+'string_col','string','Inferred from Parquet file.'
+'timestamp_col','timestamp','Inferred from Parquet file.'
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+# Make sure creating a table with the same name doesn't throw an error when
+# IF NOT EXISTS is specified.
+create table if not exists ddl_test_db.like_alltypestiny_file like parquet
+'$FILESYSTEM_PREFIX/test-warehouse/schemas/zipcode_incomes.parquet'
+---- RESULTS
+====
+---- QUERY
+# Should not have changed since last statement was IF NOT EXISTS.
+describe ddl_test_db.like_alltypestiny_file
+---- RESULTS
+'id','int','Inferred from Parquet file.'
+'bool_col','boolean','Inferred from Parquet file.'
+'tinyint_col','int','Inferred from Parquet file.'
+'smallint_col','int','Inferred from Parquet file.'
+'int_col','int','Inferred from Parquet file.'
+'bigint_col','bigint','Inferred from Parquet file.'
+'float_col','float','Inferred from Parquet file.'
+'double_col','double','Inferred from Parquet file.'
+'date_string_col','string','Inferred from Parquet file.'
+'string_col','string','Inferred from Parquet file.'
+'timestamp_col','timestamp','Inferred from Parquet file.'
+---- TYPES
+STRING, STRING, STRING
+====
+---- 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<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
+drop table allcomplextypes_clone
+---- RESULTS
+====
+---- 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<int>,\n  int_map:map<string,int>\n>','Inferred from Parquet file.'
+'t_array_basic','array<int>','Inferred from Parquet file.'
+'t_array_struct','array<struct<\n  f_int1:int,\n  f_int2:int,\n  f_int3:int\n>>','Inferred from Parquet file.'
+'t_array_array','array<array<int>>','Inferred from Parquet file.'
+'t_array_map','array<map<string,int>>','Inferred from Parquet file.'
+'map_int','map<string,int>','Inferred from Parquet file.'
+'map_struct','map<string,struct<\n  f_int:int,\n  f_int2:int\n>>','Inferred from Parquet file.'
+'map_array','map<string,array<int>>','Inferred from Parquet file.'
+'map_map','map<string,map<string,int>>','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<int>,\n  int_map:map<string,int>\n>','Inferred from Parquet file.'
+'t_array_basic','array<int>','Inferred from Parquet file.'
+'t_array_struct','array<struct<\n  f_int1:int,\n  f_int2:int,\n  f_int3:int\n>>','Inferred from Parquet file.'
+'t_array_array','array<array<int>>','Inferred from Parquet file.'
+'t_array_map','array<map<string,int>>','Inferred from Parquet file.'
+'map_int','map<string,int>','Inferred from Parquet file.'
+'map_struct','map<string,struct<\n  f_int:int,\n  f_int2:int\n>>','Inferred from Parquet file.'
+'map_array','map<string,array<int>>','Inferred from Parquet file.'
+'map_map','map<string,map<string,int>>','Inferred from Parquet file.'
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+drop table if exists ddl_test_db.temp_modern_table
+---- RESULTS
+====

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/19ff4709/testdata/workloads/functional-query/queries/QueryTest/create-table-like-table.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-query/queries/QueryTest/create-table-like-table.test b/testdata/workloads/functional-query/queries/QueryTest/create-table-like-table.test
new file mode 100644
index 0000000..946ac3a
--- /dev/null
+++ b/testdata/workloads/functional-query/queries/QueryTest/create-table-like-table.test
@@ -0,0 +1,215 @@
+====
+---- QUERY
+# CREATE TABLE LIKE on partitioned table
+create table alltypes_test like functional_seq_snap.alltypes
+stored as parquet
+---- RESULTS
+====
+---- QUERY
+# Make sure no data exists for this table
+select count(*) from alltypes_test
+---- RESULTS
+0
+---- TYPES
+BIGINT
+====
+---- QUERY
+# Should be able to insert into this table
+insert overwrite table alltypes_test
+partition (year=2009, month=4)
+select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
+float_col, double_col, date_string_col, string_col, timestamp_col
+from functional.alltypes where year=2009 and month=4
+---- RESULTS
+year=2009/month=4/: 300
+====
+---- QUERY
+# Make sure we can read the new data.
+select count(*) from alltypes_test
+---- RESULTS
+300
+---- TYPES
+BIGINT
+====
+---- QUERY
+# CREATE TABLE LIKE on a view
+create table like_view like functional.view_view
+---- RESULTS
+====
+---- QUERY
+describe like_view
+---- RESULTS
+'id','int',''
+'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
+show table stats like_view
+---- LABELS
+#ROWS, #FILES, SIZE, BYTES CACHED, CACHE REPLICATION, FORMAT, INCREMENTAL STATS, LOCATION
+---- RESULTS
+-1,0,'0B','NOT CACHED','NOT CACHED','TEXT','false',regex:.*
+---- TYPES
+BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
+====
+---- QUERY
+create table like_view_parquet like functional.view_view stored as parquet
+---- RESULTS
+====
+---- QUERY
+show table stats like_view_parquet
+---- LABELS
+#ROWS, #FILES, SIZE, BYTES CACHED, CACHE REPLICATION, FORMAT, INCREMENTAL STATS, LOCATION
+---- RESULTS
+-1,0,'0B','NOT CACHED','NOT CACHED','PARQUET','false',regex:.*
+---- TYPES
+BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
+====
+---- QUERY
+# This should copy the file format from the source table (rc)
+create external table jointbl_rc_like like functional_rc_gzip.jointbl
+location '$FILESYSTEM_PREFIX/test-warehouse/jointbl_rc_gzip'
+---- RESULTS
+====
+---- QUERY
+# should get some results back
+select * from jointbl_rc_like order by test_id limit 3
+---- RESULTS
+1001,'Name1',94611,5000
+1002,'Name2',94611,5000
+1003,'Name3',94611,5000
+---- TYPES
+BIGINT, STRING, INT, INT
+====
+---- QUERY
+# CREATE TABLE LIKE on unpartitioned table.
+create table jointbl_like like functional.jointbl
+---- RESULTS
+====
+---- QUERY
+# Make sure the new table can be queried and no data exists for this table.
+select count(*) from jointbl_like
+---- RESULTS
+0
+---- TYPES
+BIGINT
+====
+---- QUERY
+# No error is thrown when IF NOT EXISTS is specified and the table already exists.
+create table if not exists jointbl_like like functional.jointbl
+---- RESULTS
+====
+---- QUERY
+# IF NOT EXISTS also applies when the src table is the same as the new table.
+create table if not exists jointbl_like like jointbl_like
+---- RESULTS
+====
+---- QUERY
+insert overwrite table jointbl_like
+select * from functional.jointbl order by test_id limit 5
+---- RESULTS
+: 5
+====
+---- QUERY
+# Make sure we can read the data.
+select * from jointbl_like
+---- RESULTS
+1001,'Name1',94611,5000
+1002,'Name2',94611,5000
+1003,'Name3',94611,5000
+1004,'Name4',94611,5000
+1005,'Name5',94611,5000
+---- TYPES
+BIGINT, STRING, INT, INT
+====
+---- 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<f1:int,f2:string>,
+  c13 array<int>,
+  c14 map<string,string>)
+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<int>','from deserializer'
+'c14','map<string,string>','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<int>','from deserializer'
+'c14','map<string,string>','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
+====

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/19ff4709/testdata/workloads/functional-query/queries/QueryTest/create-table.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-query/queries/QueryTest/create-table.test b/testdata/workloads/functional-query/queries/QueryTest/create-table.test
new file mode 100644
index 0000000..f3b9dda
--- /dev/null
+++ b/testdata/workloads/functional-query/queries/QueryTest/create-table.test
@@ -0,0 +1,296 @@
+====
+---- QUERY
+# This database is expected to have been created.
+show databases like 'ddl_test_db'
+---- RESULTS
+'ddl_test_db',''
+---- TYPES
+STRING,STRING
+====
+---- QUERY
+show tables in ddl_test_db
+---- RESULTS
+====
+---- QUERY
+create table ddl_test_db.testtbl(i int, s string COMMENT 'String col') STORED AS TEXTFILE
+---- RESULTS
+====
+---- QUERY
+# Make sure creating a table with the same name doesn't throw an error when
+# IF NOT EXISTS is specified.
+create table if not exists ddl_test_db.testtbl(i int, s string)
+ROW FORMAT DELIMITED
+FIELDS TERMINATED BY '\t'
+ESCAPED BY '\\'
+LINES TERMINATED BY '\n'
+STORED AS TEXTFILE
+---- RESULTS
+====
+---- QUERY
+show tables in ddl_test_db
+---- RESULTS
+'testtbl'
+---- TYPES
+STRING
+====
+---- QUERY
+describe ddl_test_db.testtbl
+---- RESULTS
+'i','int',''
+'s','string','String col'
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+insert overwrite table ddl_test_db.testtbl SELECT 1, 'Hi'
+from functional.alltypes limit 10
+---- RESULTS
+: 10
+====
+---- QUERY
+select * from ddl_test_db.testtbl
+---- RESULTS
+1,'Hi'
+1,'Hi'
+1,'Hi'
+1,'Hi'
+1,'Hi'
+1,'Hi'
+1,'Hi'
+1,'Hi'
+1,'Hi'
+1,'Hi'
+---- TYPES
+INT, STRING
+====
+---- QUERY
+create table ddl_test_db.testtbl_part(i int, s string) PARTITIONED BY (id int comment 'C')
+---- RESULTS
+====
+---- QUERY
+# Partition columns are displayed as part of DESCRIBE <table>
+describe ddl_test_db.testtbl_part
+---- RESULTS
+'i','int',''
+'s','string',''
+'id','int','C'
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+insert overwrite table ddl_test_db.testtbl_part partition(id=1)
+select 10, 'Ten' from functional.alltypes limit 1
+---- RESULTS
+id=1/: 1
+====
+---- QUERY
+insert overwrite table ddl_test_db.testtbl_part partition(id=2)
+select 20, 'Twenty' from functional.alltypes limit 2
+---- RESULTS
+id=2/: 2
+====
+---- QUERY
+select * from ddl_test_db.testtbl_part
+---- RESULTS
+10,'Ten',1
+20,'Twenty',2
+20,'Twenty',2
+---- TYPES
+INT, STRING, INT
+====
+---- QUERY
+select * from ddl_test_db.testtbl_part where id = 1
+---- RESULTS
+10,'Ten',1
+---- TYPES
+INT, STRING, INT
+====
+---- QUERY
+use ddl_test_db
+---- RESULTS
+====
+---- QUERY
+show tables
+---- RESULTS
+'testtbl'
+'testtbl_part'
+---- TYPES
+STRING
+====
+---- QUERY
+# Make sure we create the table in the proper database after a "use"
+create table testtbl2(f float, d double) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|'
+---- RESULTS
+====
+---- QUERY
+show tables
+---- RESULTS
+'testtbl'
+'testtbl2'
+'testtbl_part'
+---- TYPES
+STRING
+====
+---- QUERY
+drop table testtbl2
+---- RESULTS
+====
+---- QUERY
+show tables
+---- RESULTS
+'testtbl'
+'testtbl_part'
+---- TYPES
+STRING
+====
+---- QUERY
+# Test creating an unpartitioned Avro table without column definitions.
+create table avro_alltypes_nopart
+with serdeproperties
+('avro.schema.url'='$FILESYSTEM_PREFIX/test-warehouse/avro_schemas/functional/alltypes.json')
+stored as avro
+---- RESULTS
+====
+---- QUERY
+describe avro_alltypes_nopart
+---- RESULTS
+'bigint_col','bigint','from deserializer'
+'bool_col','boolean','from deserializer'
+'date_string_col','string','from deserializer'
+'double_col','double','from deserializer'
+'float_col','float','from deserializer'
+'id','int','from deserializer'
+'int_col','int','from deserializer'
+'smallint_col','int','from deserializer'
+'string_col','string','from deserializer'
+'timestamp_col','string','from deserializer'
+'tinyint_col','int','from deserializer'
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+# Test creating a partitioned Avro table without column definitions.
+create table avro_alltypes_part
+partitioned by (year int, month int)
+with serdeproperties
+('avro.schema.url'='$FILESYSTEM_PREFIX/test-warehouse/avro_schemas/functional/alltypes.json')
+stored as avro
+---- RESULTS
+====
+---- QUERY
+describe avro_alltypes_part
+---- RESULTS
+'bigint_col','bigint','from deserializer'
+'bool_col','boolean','from deserializer'
+'date_string_col','string','from deserializer'
+'double_col','double','from deserializer'
+'float_col','float','from deserializer'
+'id','int','from deserializer'
+'int_col','int','from deserializer'
+'month','int',''
+'smallint_col','int','from deserializer'
+'string_col','string','from deserializer'
+'timestamp_col','string','from deserializer'
+'tinyint_col','int','from deserializer'
+'year','int',''
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+drop table avro_alltypes_part
+---- RESULTS
+====
+---- QUERY
+drop table avro_alltypes_nopart
+---- RESULTS
+====
+---- QUERY
+drop table testtbl
+---- RESULTS
+====
+---- QUERY
+drop table testtbl_part
+---- RESULTS
+====
+---- QUERY
+show tables
+---- RESULTS
+---- TYPES
+STRING
+====
+---- QUERY
+drop table if exists non_existent_db.tbl
+---- RESULTS
+====
+---- QUERY
+# Test table creation with tblproperty and serdeproperty lengths just within limits
+create table ddl_test_db.short_properties (i int)
+with serdeproperties(
+'keykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeyk'
+=
+'valuevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluev
 aluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalueval
 uevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalue
 valuevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalueva
 luevaluevalue'
+) tblproperties(
+'keykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeyk'
+=
+'valuevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluev
 aluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalueval
 uevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalue
 valuevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalueva
 luevaluevalue'
+)
+---- RESULTS
+====
+---- QUERY
+drop table if exists test_property_length_db.short_properties
+---- RESULTS
+====
+---- QUERY
+# IMPALA-1740: Test setting the skip.header.line.count tblproperty
+create table skip_header_test_a (i1 integer) tblproperties('skip.header.line.count'='2')
+---- RESULTS
+====
+---- QUERY
+# IMPALA-1740: Test setting the skip.header.line.count tblproperty on a Parquet table
+create table skip_header_test_d (i1 integer) stored as parquet
+tblproperties('skip.header.line.count'='2')
+---- RESULTS
+====
+---- QUERY
+# IMPALA-1740: Test setting an invalid skip.header.line.count tblproperty
+create table skip_header_test_b (i1 integer) tblproperties('skip.header.line.count'='-1')
+---- CATCH
+Invalid value for table property skip.header.line.count:
+====
+---- QUERY
+# IMPALA-1740: Test setting an invalid skip.header.line.count tblproperty
+create table skip_header_test_c (i1 integer) tblproperties('skip.header.line.count'='foo')
+---- CATCH
+Invalid value for table property skip.header.line.count:
+====
+---- 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<table:int,`comment`:string,`select`:decimal(8,2)>,
+  a array<struct<`replace`:boolean,`location`:varchar(10)>>,
+  m map<string,struct<`fields`:int,from:timestamp>>
+)
+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<struct<\n  replace:boolean,\n  location:varchar(10)\n>>',''
+'m','map<string,struct<\n  fields:int,\n  from:timestamp\n>>',''
+'year','int',''
+'month','int',''
+---- TYPES
+STRING, STRING, STRING
+====
+---- 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
+====

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/19ff4709/testdata/workloads/functional-query/queries/QueryTest/create.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-query/queries/QueryTest/create.test b/testdata/workloads/functional-query/queries/QueryTest/create.test
deleted file mode 100644
index 369e234..0000000
--- a/testdata/workloads/functional-query/queries/QueryTest/create.test
+++ /dev/null
@@ -1,816 +0,0 @@
-====
----- QUERY
-drop table if exists ddl_test_db.temp_decimal_table
----- RESULTS
-====
----- QUERY
-create table ddl_test_db.temp_decimal_table like parquet
-'$FILESYSTEM_PREFIX/test-warehouse/schemas/decimal.parquet'
----- RESULTS
-====
----- QUERY
-describe ddl_test_db.temp_decimal_table
----- RESULTS
-'d32','decimal(3,2)','Inferred from Parquet file.'
-'d11','decimal(1,1)','Inferred from Parquet file.'
-'d1015','decimal(15,10)','Inferred from Parquet file.'
----- TYPES
-STRING, STRING, STRING
-====
----- QUERY
-drop table if exists ddl_test_db.temp_decimal_table
----- RESULTS
-====
----- QUERY
-create table ddl_test_db.test_like_file_create like parquet
-'$FILESYSTEM_PREFIX/test-warehouse/schemas/zipcode_incomes.parquet'
----- RESULTS
-====
----- QUERY
-describe ddl_test_db.test_like_file_create
----- RESULTS
-'id','string','Inferred from Parquet file.'
-'zip','string','Inferred from Parquet file.'
-'description1','string','Inferred from Parquet file.'
-'description2','string','Inferred from Parquet file.'
-'income','int','Inferred from Parquet file.'
----- TYPES
-STRING, STRING, STRING
-====
----- QUERY
-drop table ddl_test_db.test_like_file_create
----- RESULTS
-====
----- QUERY
-create table if not exists ddl_test_db.test_like_file_create like parquet
-'$FILESYSTEM_PREFIX/test-warehouse/schemas/alltypestiny.parquet'
----- RESULTS
-====
----- QUERY
-describe ddl_test_db.test_like_file_create
----- RESULTS
-'id','int','Inferred from Parquet file.'
-'bool_col','boolean','Inferred from Parquet file.'
-'tinyint_col','int','Inferred from Parquet file.'
-'smallint_col','int','Inferred from Parquet file.'
-'int_col','int','Inferred from Parquet file.'
-'bigint_col','bigint','Inferred from Parquet file.'
-'float_col','float','Inferred from Parquet file.'
-'double_col','double','Inferred from Parquet file.'
-'date_string_col','string','Inferred from Parquet file.'
-'string_col','string','Inferred from Parquet file.'
-'timestamp_col','timestamp','Inferred from Parquet file.'
----- TYPES
-STRING, STRING, STRING
-====
----- QUERY
-create table if not exists ddl_test_db.test_like_file_create like parquet
-'$FILESYSTEM_PREFIX/test-warehouse/schemas/zipcode_incomes.parquet'
----- RESULTS
-====
----- QUERY
-# should not have changed since last statement was IF NOT EXISTS
-describe ddl_test_db.test_like_file_create
----- RESULTS
-'id','int','Inferred from Parquet file.'
-'bool_col','boolean','Inferred from Parquet file.'
-'tinyint_col','int','Inferred from Parquet file.'
-'smallint_col','int','Inferred from Parquet file.'
-'int_col','int','Inferred from Parquet file.'
-'bigint_col','bigint','Inferred from Parquet file.'
-'float_col','float','Inferred from Parquet file.'
-'double_col','double','Inferred from Parquet file.'
-'date_string_col','string','Inferred from Parquet file.'
-'string_col','string','Inferred from Parquet file.'
-'timestamp_col','timestamp','Inferred from Parquet file.'
----- TYPES
-STRING, STRING, STRING
-====
----- QUERY
-drop table ddl_test_db.test_like_file_create
----- RESULTS
-====
----- QUERY
-# It should show up now
-show databases like 'ddl_test_db'
----- RESULTS
-'ddl_test_db',''
----- TYPES
-STRING,STRING
-====
----- QUERY
-# Make sure creating a database with the same name doesn't throw an error when
-# IF NOT EXISTS is specified.
-create database if not exists ddl_test_db
----- RESULTS
-====
----- QUERY
-show tables in ddl_test_db
----- RESULTS
-====
----- QUERY
-create table ddl_test_db.testtbl(i int, s string COMMENT 'String col') STORED AS TEXTFILE
----- RESULTS
-====
----- QUERY
-# Make sure creating a table with the same name doesn't throw an error when
-# IF NOT EXISTS is specified.
-create table if not exists ddl_test_db.testtbl(i int, s string)
-ROW FORMAT DELIMITED
-FIELDS TERMINATED BY '\t'
-ESCAPED BY '\\'
-LINES TERMINATED BY '\n'
-STORED AS TEXTFILE
----- RESULTS
-====
----- QUERY
-show tables in ddl_test_db
----- RESULTS
-'testtbl'
----- TYPES
-STRING
-====
----- QUERY
-describe ddl_test_db.testtbl
----- RESULTS
-'i','int',''
-'s','string','String col'
----- TYPES
-STRING, STRING, STRING
-====
----- QUERY
-insert overwrite table ddl_test_db.testtbl SELECT 1, 'Hi'
-from functional.alltypes limit 10
----- RESULTS
-: 10
-====
----- QUERY
-select * from ddl_test_db.testtbl
----- RESULTS
-1,'Hi'
-1,'Hi'
-1,'Hi'
-1,'Hi'
-1,'Hi'
-1,'Hi'
-1,'Hi'
-1,'Hi'
-1,'Hi'
-1,'Hi'
----- TYPES
-INT, STRING
-====
----- QUERY
-create table ddl_test_db.testtbl_part(i int, s string) PARTITIONED BY (id int comment 'C')
----- RESULTS
-====
----- QUERY
-# Partition columns are displayed as part of DESCRIBE <table>
-describe ddl_test_db.testtbl_part
----- RESULTS
-'i','int',''
-'s','string',''
-'id','int','C'
----- TYPES
-STRING, STRING, STRING
-====
----- QUERY
-insert overwrite table ddl_test_db.testtbl_part partition(id=1)
-select 10, 'Ten' from functional.alltypes limit 1
----- RESULTS
-id=1/: 1
-====
----- QUERY
-insert overwrite table ddl_test_db.testtbl_part partition(id=2)
-select 20, 'Twenty' from functional.alltypes limit 2
----- RESULTS
-id=2/: 2
-====
----- QUERY
-select * from ddl_test_db.testtbl_part
----- RESULTS
-10,'Ten',1
-20,'Twenty',2
-20,'Twenty',2
----- TYPES
-INT, STRING, INT
-====
----- QUERY
-select * from ddl_test_db.testtbl_part where id = 1
----- RESULTS
-10,'Ten',1
----- TYPES
-INT, STRING, INT
-====
----- QUERY
-use ddl_test_db
----- RESULTS
-====
----- QUERY
-show tables
----- RESULTS
-'testtbl'
-'testtbl_part'
----- TYPES
-STRING
-====
----- QUERY
-# Make sure we create the table in the proper database after a "use"
-create table testtbl2(f float, d double) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|'
----- RESULTS
-====
----- QUERY
-show tables
----- RESULTS
-'testtbl'
-'testtbl2'
-'testtbl_part'
----- TYPES
-STRING
-====
----- QUERY
-drop table testtbl2
----- RESULTS
-====
----- QUERY
-show tables
----- RESULTS
-'testtbl'
-'testtbl_part'
----- TYPES
-STRING
-====
----- QUERY
-# CREATE TABLE LIKE on partitioned table
-create table alltypes_test like functional_seq_snap.alltypes
-stored as parquet
----- RESULTS
-====
----- QUERY
-# CREATE TABLE LIKE on a view
-create table like_view like functional.view_view
----- RESULTS
-====
----- QUERY
-describe like_view
----- RESULTS
-'id','int',''
-'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
-show table stats like_view
----- LABELS
-#ROWS, #FILES, SIZE, BYTES CACHED, CACHE REPLICATION, FORMAT, INCREMENTAL STATS, LOCATION
----- RESULTS
--1,0,'0B','NOT CACHED','NOT CACHED','TEXT','false',regex:.*
----- TYPES
-BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
-====
----- QUERY
-drop table like_view
----- RESULTS
-====
----- QUERY
-create table like_view_parquet like functional.view_view stored as parquet
----- RESULTS
-====
----- QUERY
-show table stats like_view_parquet
----- LABELS
-#ROWS, #FILES, SIZE, BYTES CACHED, CACHE REPLICATION, FORMAT, INCREMENTAL STATS, LOCATION
----- RESULTS
--1,0,'0B','NOT CACHED','NOT CACHED','PARQUET','false',regex:.*
----- TYPES
-BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
-====
----- QUERY
-drop table like_view_parquet
----- RESULTS
-====
----- QUERY
-# Make sure no data exists for this table
-select count(*) from alltypes_test
----- RESULTS
-0
----- TYPES
-BIGINT
-====
----- QUERY
-# Should be able to insert into this table
-insert overwrite table alltypes_test
-partition (year=2009, month=4)
-select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
-float_col, double_col, date_string_col, string_col, timestamp_col
-from functional.alltypes where year=2009 and month=4
----- RESULTS
-year=2009/month=4/: 300
-====
----- QUERY
-# Make sure we can read the new data.
-select count(*) from alltypes_test
----- RESULTS
-300
----- TYPES
-BIGINT
-====
----- QUERY
-# This should copy the file format from the source table (rc)
-create external table jointbl_like like functional_rc_gzip.jointbl
-location '$FILESYSTEM_PREFIX/test-warehouse/jointbl_rc_gzip'
----- RESULTS
-====
----- QUERY
-# should get some results back
-select * from jointbl_like order by test_id limit 3
----- RESULTS
-1001,'Name1',94611,5000
-1002,'Name2',94611,5000
-1003,'Name3',94611,5000
----- TYPES
-BIGINT, STRING, INT, INT
-====
----- QUERY
-# CREATE TABLE LIKE on unpartitioned table.
-create table testtbl_like like testtbl
----- RESULTS
-====
----- QUERY
-# Make sure the new table can be queried and no data exists for this table.
-select count(*) from testtbl_like
----- RESULTS
-0
----- TYPES
-BIGINT
-====
----- QUERY
-# No error is thrown when IF NOT EXISTS is specified and the table already exists.
-create table if not exists testtbl_like like testtbl
----- RESULTS
-====
----- QUERY
-# IF NOT EXISTS also applies when the src table is the same as the new table.
-create table if not exists testtbl_like like testtbl_like
----- RESULTS
-====
----- QUERY
-insert overwrite table testtbl_like
-select * from testtbl limit 5
----- RESULTS
-: 5
-====
----- QUERY
-# Make sure we can read the data.
-select * from testtbl_like
----- RESULTS
-1,'Hi'
-1,'Hi'
-1,'Hi'
-1,'Hi'
-1,'Hi'
----- TYPES
-INT, STRING
-====
----- QUERY
-# Ensure that a table can be created using CTAS
-create table ctas_join stored as parquet as
-select j.*, a.int_col, 1*2
-from functional.jointbl j join functional_seq_snap.alltypes a
-  on (j.alltypes_id=a.id)
----- RESULTS
-'Inserted 12 row(s)'
----- TYPES
-STRING
-====
----- QUERY
-describe ctas_join
----- RESULTS
-'test_id','bigint',''
-'test_name','string',''
-'test_zip','int',''
-'alltypes_id','int',''
-'int_col','int',''
-'_c2','smallint',''
----- TYPES
-STRING, STRING, STRING
-====
----- QUERY
-select * from ctas_join
----- RESULTS
-1001,'Name1',94611,5000,0,2
-1002,'Name2',94611,5000,0,2
-1003,'Name3',94611,5000,0,2
-1004,'Name4',94611,5000,0,2
-1005,'Name5',94611,5000,0,2
-1106,'Name6',94612,5000,0,2
-1006,'Name16',94612,5000,0,2
-1006,'Name6',94616,5000,0,2
-1106,'Name16',94612,5000,0,2
-1106,'Name6',94616,5000,0,2
-1006,'Name16',94616,5000,0,2
-1106,'Name16',94616,5000,0,2
----- TYPES
-BIGINT, STRING, INT, INT, INT, SMALLINT
-====
----- QUERY
-# Since the table already exists, the second CTAS should be a no-op
-create table if not exists ctas_join stored as parquet as
-select j.*, a.int_col, 1*2
-from functional.jointbl j join functional_seq_snap.alltypes a
-  on (j.alltypes_id=a.id) limit 1
----- RESULTS
-'Inserted 0 row(s)'
----- TYPES
-STRING
-====
----- QUERY
-select * from ctas_join
----- RESULTS
-1001,'Name1',94611,5000,0,2
-1002,'Name2',94611,5000,0,2
-1003,'Name3',94611,5000,0,2
-1004,'Name4',94611,5000,0,2
-1005,'Name5',94611,5000,0,2
-1106,'Name6',94612,5000,0,2
-1006,'Name16',94612,5000,0,2
-1006,'Name6',94616,5000,0,2
-1106,'Name16',94612,5000,0,2
-1106,'Name6',94616,5000,0,2
-1006,'Name16',94616,5000,0,2
-1106,'Name16',94616,5000,0,2
----- TYPES
-BIGINT, STRING, INT, INT, INT, SMALLINT
-====
----- QUERY
-# Validate CTAS with LIMIT 0
-create table if not exists ctas_join_limit0 stored as textfile as
-select * from functional.jointbl limit 0
----- RESULTS
-'Inserted 0 row(s)'
----- TYPES
-STRING
-====
----- QUERY
-describe ctas_join_limit0
----- RESULTS
-'test_id','bigint',''
-'test_name','string',''
-'test_zip','int',''
-'alltypes_id','int',''
----- TYPES
-STRING, STRING, STRING
-====
----- QUERY
-select * from ctas_join_limit0
----- RESULTS
----- TYPES
-BIGINT, STRING, INT, INT
-====
----- QUERY
-# Validate CTAS with LIMIT 0
-create table if not exists ctas_join_limit0 stored as textfile as
-select * from functional.jointbl limit 0
----- RESULTS
-'Inserted 0 row(s)'
----- TYPES
-STRING
-====
----- QUERY
-select * from ctas_join_limit0
----- RESULTS
----- TYPES
-BIGINT, STRING, INT, INT
-====
----- QUERY
-create table if not exists ctas_join_limit0 stored as textfile as
-select * from functional.jointbl limit 4
----- RESULTS
-'Inserted 0 row(s)'
----- TYPES
-STRING
-====
----- QUERY
-select * from ctas_join_limit0
----- RESULTS
----- TYPES
-BIGINT, STRING, INT, INT
-====
----- QUERY
-# IMPALA-2203: Test CTAS from a select statement that has outer-joined inline views with
-# constant exprs in the select list. The non-matches of the outer join should be NULL.
-create table ctas_impala_2203 as
-select a.id, a.bool_col, a.tinyint_col, a.smallint_col, a.int_col, a.bigint_col,
-  b.float_col, b.double_col, b.date_string_col, b.string_col, b.timestamp_col
-from
-(select id, false bool_col, 1 tinyint_col, 2 smallint_col, 3 int_col, 4 bigint_col
- from functional.alltypestiny where id between 0 and 2) a
-full outer join
-(select id, 5 float_col, 6 double_col, "s1" date_string_col, "s2" string_col,
-   cast("2009-02-06 00:01:00" as timestamp) timestamp_col
- from functional.alltypestiny where id between 1 and 3) b
-on (a.id = b.id)
----- RESULTS
-'Inserted 4 row(s)'
----- TYPES
-STRING
-====
----- QUERY
-select * from ctas_impala_2203
----- RESULTS: VERIFY_IS_EQUAL_SORTED
-0,false,1,2,3,4,NULL,NULL,'NULL','NULL',NULL
-1,false,1,2,3,4,5,6,'s1','s2',2009-02-06 00:01:00
-2,false,1,2,3,4,5,6,'s1','s2',2009-02-06 00:01:00
-NULL,NULL,NULL,NULL,NULL,NULL,5,6,'s1','s2',2009-02-06 00:01:00
----- TYPES
-INT, BOOLEAN, TINYINT, TINYINT, TINYINT, TINYINT, TINYINT, TINYINT, STRING, STRING, TIMESTAMP
-====
----- QUERY
-# Test creating an unpartitioned Avro table without column definitions.
-create table avro_alltypes_nopart
-with serdeproperties
-('avro.schema.url'='$FILESYSTEM_PREFIX/test-warehouse/avro_schemas/functional/alltypes.json')
-stored as avro
----- RESULTS
-====
----- QUERY
-describe avro_alltypes_nopart
----- RESULTS
-'bigint_col','bigint','from deserializer'
-'bool_col','boolean','from deserializer'
-'date_string_col','string','from deserializer'
-'double_col','double','from deserializer'
-'float_col','float','from deserializer'
-'id','int','from deserializer'
-'int_col','int','from deserializer'
-'smallint_col','int','from deserializer'
-'string_col','string','from deserializer'
-'timestamp_col','string','from deserializer'
-'tinyint_col','int','from deserializer'
----- TYPES
-STRING, STRING, STRING
-====
----- QUERY
-# Test creating a partitioned Avro table without column definitions.
-create table avro_alltypes_part
-partitioned by (year int, month int)
-with serdeproperties
-('avro.schema.url'='$FILESYSTEM_PREFIX/test-warehouse/avro_schemas/functional/alltypes.json')
-stored as avro
----- RESULTS
-====
----- QUERY
-describe avro_alltypes_part
----- RESULTS
-'bigint_col','bigint','from deserializer'
-'bool_col','boolean','from deserializer'
-'date_string_col','string','from deserializer'
-'double_col','double','from deserializer'
-'float_col','float','from deserializer'
-'id','int','from deserializer'
-'int_col','int','from deserializer'
-'month','int',''
-'smallint_col','int','from deserializer'
-'string_col','string','from deserializer'
-'timestamp_col','string','from deserializer'
-'tinyint_col','int','from deserializer'
-'year','int',''
----- TYPES
-STRING, STRING, STRING
-====
----- QUERY
-drop table avro_alltypes_part
----- RESULTS
-====
----- QUERY
-drop table avro_alltypes_nopart
----- RESULTS
-====
----- QUERY
-drop table ctas_join
----- RESULTS
-====
----- QUERY
-drop table ctas_join_limit0
----- RESULTS
-====
----- QUERY
-drop table ctas_impala_2203
----- RESULTS
-====
----- QUERY
-drop table testtbl
----- RESULTS
-====
----- QUERY
-drop table testtbl_part
----- RESULTS
-====
----- QUERY
-drop table alltypes_test
----- RESULTS
-====
----- QUERY
-drop table jointbl_like
----- RESULTS
-====
----- QUERY
-drop table testtbl_like
----- RESULTS
-====
----- QUERY
-show tables
----- RESULTS
----- TYPES
-STRING
-====
----- QUERY
-drop table if exists non_existent_db.tbl
----- RESULTS
-====
----- QUERY
-# Test DROP DATABASE ... [CASCADE | RESTRICT]
-create database if not exists test_drop_cascade_db
-====
----- QUERY
-show databases like 'test_drop_cascade_db'
----- RESULTS
-'test_drop_cascade_db',''
----- TYPES
-STRING,STRING
-====
----- QUERY
-create table if not exists test_drop_cascade_db.t1 (i int);
-create table if not exists test_drop_cascade_db.t2 (i int)
-  partitioned by (year smallint, month smallint);
-insert into test_drop_cascade_db.t2 partition (year=2015, month=8) values(1);
-create external table if not exists test_drop_cascade_db.t3 like functional.alltypes
-  location '$FILESYSTEM_PREFIX/test-warehouse/alltypes_external';
-create view if not exists test_drop_cascade_db.v1 as
-  select int_col from functional.alltypes;
-create function if not exists test_drop_cascade_db.f1() returns string
-  location '$FILESYSTEM_PREFIX/test-warehouse/libTestUdfs.so' symbol='NoArgs';
-create aggregate function if not exists test_drop_cascade_db.f2(int, string) RETURNS int
-  location '$FILESYSTEM_PREFIX/test-warehouse/libTestUdas.so' UPDATE_FN='TwoArgUpdate'
----- RESULTS
-====
----- QUERY
-show tables in test_drop_cascade_db
----- RESULTS
-'t1'
-'t2'
-'t3'
-'v1'
----- TYPES
-STRING
-====
----- QUERY
-show functions in test_drop_cascade_db
----- RESULTS
-'STRING','f1()','NATIVE','true'
----- TYPES
-STRING, STRING, STRING, STRING
-====
----- QUERY
-show aggregate functions in test_drop_cascade_db
----- RESULTS
-'INT','f2(INT, STRING)','NATIVE','true'
----- TYPES
-STRING, STRING, STRING, STRING
-====
----- QUERY
-# Should drop all tables and the database
-drop database test_drop_cascade_db cascade
----- RESULTS
-====
----- QUERY
-show databases like 'test_drop_cascade_db'
----- RESULTS
-====
----- QUERY
-create database if not exists test_drop_restrict_db
-====
----- QUERY
-show databases like 'test_drop_restrict_db'
----- RESULTS
-'test_drop_restrict_db',''
----- TYPES
-STRING,STRING
-====
----- QUERY
-drop database test_drop_restrict_db restrict
----- RESULTS
-====
----- QUERY
-show databases like 'test_drop_restrict_db'
----- RESULTS
-====
----- QUERY
-# Test tblproperties and serdeproperties key and property value length
-create database if not exists test_property_length_db
-====
----- QUERY
-show databases like 'test_property_length_db'
----- RESULTS
-'test_property_length_db',''
----- TYPES
-STRING,STRING
-====
----- QUERY
-drop table if exists test_property_length_db.short_properties
----- RESULTS
-====
----- QUERY
-# create with tblproperty lengths just within limits
-create table test_property_length_db.short_properties (i int)
-with serdeproperties(
-'keykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeyk'
-=
-'valuevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluev
 aluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalueval
 uevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalue
 valuevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalueva
 luevaluevalue'
-) tblproperties(
-'keykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeyk'
-=
-'valuevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluev
 aluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalueval
 uevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalue
 valuevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalueva
 luevaluevalue'
-)
----- RESULTS
-====
----- QUERY
-drop table if exists test_property_length_db.short_properties
----- RESULTS
-====
----- QUERY
-# Need to switch databases before dropping
-use default;
-drop database if exists test_property_length_db
----- RESULTS
-====
----- QUERY
-show databases like 'test_property_length_db'
----- RESULTS
-====
----- QUERY
-drop table if exists ddl_test_db.i_1687_t;
-drop table if exists ddl_test_db.i_1687_p;
-create table ddl_test_db.i_1687_t (a int, b int);
-insert into ddl_test_db.i_1687_t values (1, 2), (3, 4);
-create table ddl_test_db.i_1687_p partitioned by (a) as select b, a from ddl_test_db.i_1687_t;
----- RESULTS
-'Inserted 2 row(s)'
-====
----- QUERY
-select * from ddl_test_db.i_1687_p;
----- RESULTS
-2,1
-4,3
----- TYPES
-INT,INT
-====
----- QUERY
-# IMPALA-2711: Make sure no memory leak from Rand().
-drop table if exists ddl_test_db.rand_ctas_t;
-create table ddl_test_db.rand_ctas_t as select rand() from functional.alltypes;
----- RESULTS
-'Inserted 7300 row(s)'
----- ERRORS
-====
----- QUERY
-drop table if exists ddl_test_db.rand_ctas_t;
----- RESULTS
-====
----- QUERY
-# IMPALA-1740: Test setting the skip.header.line.count tblproperty
-drop table if exists i1740_create;
-create table i1740_create (i1 integer) tblproperties('skip.header.line.count'='2');
----- RESULTS
-====
----- QUERY
-# IMPALA-1740: Test setting the skip.header.line.count tblproperty
-drop table if exists i1740_create;
-create table i1740_create (i1 integer) tblproperties('skip.header.line.count'='-1');
----- CATCH
-Invalid value for table property skip.header.line.count:
-====
----- QUERY
-# IMPALA-1740: Test setting the skip.header.line.count tblproperty
-drop table if exists i1740_create;
-create table i1740_create (i1 integer) tblproperties('skip.header.line.count'='foo');
----- CATCH
-Invalid value for table property skip.header.line.count:
-====
----- QUERY
-# IMPALA-1740: Test setting the skip.header.line.count tblproperty
-drop table if exists i1740_create;
-create table i1740_create (i1 integer) stored as parquet tblproperties('skip.header.line.count'='2');
----- RESULTS
-====


Mime
View raw message