You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2020/04/14 16:52:49 UTC

[impala] 01/02: IMPALA-8980: Remove functional*.alltypesinsert from EE tests

This is an automated email from the ASF dual-hosted git repository.

tarmstrong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit c32849a3912a6fe295e74269bf0c1f350962d57f
Author: Adam Tamas <ta...@cloudera.com>
AuthorDate: Mon Mar 23 13:40:35 2020 +0100

    IMPALA-8980: Remove functional*.alltypesinsert from EE tests
    
    -Modified the ‘test_insert.py’ so the tests can run parallel.
      -Every test will create its own temporary tables for insert testing.
    -Swapped out the  SETUP tags to Truncate table QUERY statement.
      -Becouse the SETUP tag is not used anymore, the correspondig
      code was removed.
    -A test query in ‘insert.test’. The test was incorrect so modified
    to test for the right behavior.
    
    Testing:
    -tests/run-tests.py query_test/test_insert.py
    -impala-py.test tests/query_test/test_insert.py
    -the same for test_insert_permutation.py and test_load.py
    
    Change-Id: I257e936868917a2fcc6c030f6c855b247e8a0eea
    Reviewed-on: http://gerrit.cloudera.org:8080/15529
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 .../functional/functional_schema_template.sql      |  24 ----
 .../queries/QueryTest/insert-mem-limit.test        |   6 +-
 .../functional-query/queries/QueryTest/insert.test | 151 +++++++++------------
 .../queries/QueryTest/insert_bad_expr.test         |   6 +-
 .../queries/QueryTest/insert_null.test             |  54 +++++---
 .../queries/QueryTest/insert_overwrite.test        |  28 ++--
 .../queries/QueryTest/insert_permutation.test      |  61 +++------
 .../functional-query/queries/QueryTest/load.test   |   5 +-
 .../functional-query/queries/QueryTest/show.test   |   4 -
 tests/common/impala_test_suite.py                  |  42 ------
 tests/custom_cluster/test_mt_dop.py                |   3 +-
 tests/query_test/test_insert.py                    |  25 ++--
 tests/query_test/test_mt_dop.py                    |   4 +-
 13 files changed, 147 insertions(+), 266 deletions(-)

diff --git a/testdata/datasets/functional/functional_schema_template.sql b/testdata/datasets/functional/functional_schema_template.sql
index e3dc3da..3f927c0 100644
--- a/testdata/datasets/functional/functional_schema_template.sql
+++ b/testdata/datasets/functional/functional_schema_template.sql
@@ -1460,30 +1460,6 @@ LOAD DATA LOCAL INPATH '{impala_home}/testdata/TblWithRaggedColumns/data.csv' OV
 ---- DATASET
 functional
 ---- BASE_TABLE_NAME
-nullinsert
----- CREATE
--- Must not be external
-CREATE TABLE IF NOT EXISTS {db_name}{db_suffix}.{table_name} (
-  str_col1 string,
-  str_col2 string,
-  str_col3 string,
-  str_col4 string,
-  int_cal int
-)
-row format delimited fields terminated by ','  escaped by '\\'
-stored as {file_format}
-LOCATION '{hdfs_location}';
-DROP TABLE IF EXISTS {db_name}{db_suffix}.{table_name}_alt;
-CREATE EXTERNAL TABLE IF NOT EXISTS {db_name}{db_suffix}.{table_name}_alt(
-  whole_row string
-)
-row format delimited fields terminated by '|'
-stored as {file_format}
-LOCATION '{hdfs_location}';
-====
----- DATASET
-functional
----- BASE_TABLE_NAME
 zipcode_incomes
 ---- COLUMNS
 id STRING
diff --git a/testdata/workloads/functional-query/queries/QueryTest/insert-mem-limit.test b/testdata/workloads/functional-query/queries/QueryTest/insert-mem-limit.test
index 84c1709..ce8a80e 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/insert-mem-limit.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/insert-mem-limit.test
@@ -1,7 +1,11 @@
 ====
 ---- QUERY
+create table alltypesinsert like functional.alltypesinsert;
+====
+---- QUERY
 # Check that hdfs writers respects mem_limit. mem_limit is tuned for a 3-node HDFS
 # minicluster.
+truncate alltypesinsert;
 set mem_limit=64m;
 insert into table alltypesinsert
 partition (year, month) /* +noclustered */
@@ -9,8 +13,6 @@ select at1.id, at1.bool_col, at1.tinyint_col, at1.smallint_col, at1.int_col, at1
   at1.float_col, at1.double_col, at1.date_string_col, at1.string_col, at1.timestamp_col,
   at1.year, at2.id as month
 from  functional.alltypes at1, functional.alltypes at2;
----- SETUP
-DROP PARTITIONS alltypesinsert
 ---- CATCH
 Memory limit exceeded
 ====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/insert.test b/testdata/workloads/functional-query/queries/QueryTest/insert.test
index 2642465..201f021 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/insert.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/insert.test
@@ -1,13 +1,17 @@
 ====
 ---- QUERY
+create table alltypesinsert like functional.alltypesinsert;
+create table alltypesnopart_insert like functional.alltypesnopart_insert;
+create table insert_string_partitioned like functional.insert_string_partitioned;
+create table table_with_header_insert like functional.table_with_header_insert;
+====
+---- QUERY
 # insert overwrite unpartitioned table
 insert overwrite table alltypesnopart_insert
 select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
 float_col, double_col, date_string_col, string_col, timestamp_col
-from alltypessmall
+from functional.alltypessmall
 where year=2009 and month=04
----- SETUP
-RESET alltypesnopart_insert
 ---- RESULTS
 : 25
 ====
@@ -47,13 +51,12 @@ int, boolean, tinyint, smallint, int, bigint, float, double, string, string
 ====
 ---- QUERY
 # insert into unpartitioned table
+truncate alltypesnopart_insert;
 insert into table alltypesnopart_insert
 select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
 float_col, double_col, date_string_col, string_col, timestamp_col
-from alltypessmall
+from functional.alltypessmall
 where year=2009 and month=04
----- SETUP
-RESET alltypesnopart_insert
 ---- RESULTS
 : 25
 ====
@@ -67,15 +70,13 @@ bigint
 ====
 ---- QUERY
 # static partition overwrite
+truncate alltypesinsert;
 insert overwrite table alltypesinsert
 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 alltypessmall
+from functional.alltypessmall
 where year=2009 and month=4
----- SETUP
-DROP PARTITIONS alltypesinsert
-RESET alltypesinsert
 ---- RESULTS
 year=2009/month=4/: 25
 ====
@@ -116,14 +117,13 @@ int, boolean, tinyint, smallint, int, bigint, float, double, string, string
 ====
 ---- QUERY
 # static partition insert$TABLE, test creation of partitions
+truncate alltypesinsert;
 insert into table alltypesinsert
 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 alltypessmall
+from functional.alltypessmall
 where year=2009 and month=4
----- SETUP
-DROP PARTITIONS alltypesinsert
 ---- RESULTS
 year=2009/month=4/: 25
 ====
@@ -138,14 +138,13 @@ bigint
 ====
 ---- QUERY
 # partially dynamic partition overwrite
+truncate alltypesinsert;
 insert overwrite table alltypesinsert
 partition (year=2009, month)
 select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
 float_col, double_col, date_string_col, string_col, timestamp_col, month
-from alltypessmall
+from functional.alltypessmall
 where year=2009 and month>1 and month<=4
----- SETUP
-DROP PARTITIONS alltypesinsert
 ---- RESULTS
 year=2009/month=2/: 25
 year=2009/month=3/: 25
@@ -238,14 +237,13 @@ int, boolean, tinyint, smallint, int, bigint, float, double, string, string
 ====
 ---- QUERY
 # partially dynamic partition insert$TABLE, check partition creation
+truncate alltypesinsert;
 insert into table alltypesinsert
 partition (year=2009, month)
 select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
 float_col, double_col, date_string_col, string_col, timestamp_col, month
-from alltypessmall
+from functional.alltypessmall
 where year=2009 and month>=1 and month<4
----- SETUP
-DROP PARTITIONS alltypesinsert
 ---- RESULTS
 year=2009/month=1/: 25
 year=2009/month=2/: 25
@@ -266,9 +264,7 @@ insert overwrite table alltypesinsert
 partition (year, month)
 select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
 float_col, double_col, date_string_col, string_col, timestamp_col, year, month
-from alltypessmall
----- SETUP
-DROP PARTITIONS alltypesinsert
+from functional.alltypessmall
 ---- RESULTS
 year=2009/month=1/: 25
 year=2009/month=2/: 25
@@ -386,14 +382,13 @@ where year=2009 and month>=1 and month<=4
 int, boolean, tinyint, smallint, int, bigint, float, double, string, string
 ====
 ---- QUERY
+truncate alltypesinsert;
 # fully dynamic partition insert$TABLE, check partition creation
 insert into table alltypesinsert
 partition (year, month)
 select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
 float_col, double_col, date_string_col, string_col, timestamp_col, year, month
-from alltypessmall
----- SETUP
-DROP PARTITIONS alltypesinsert
+from functional.alltypessmall
 ---- RESULTS
 year=2009/month=1/: 25
 year=2009/month=2/: 25
@@ -411,9 +406,8 @@ bigint
 ====
 ---- QUERY
 # test insert into ... select *
-insert into alltypesinsert partition(year, month) select * from alltypessmall
----- SETUP
-RESET alltypesinsert
+truncate alltypesinsert;
+insert into alltypesinsert partition(year, month) select * from functional.alltypessmall
 ---- RESULTS
 year=2009/month=1/: 25
 year=2009/month=2/: 25
@@ -430,10 +424,8 @@ bigint
 ====
 ---- QUERY
 # static partition insert into string-partitioned table with special characters in partition key
-INSERT INTO TABLE insert_string_partitioned PARTITION(s2="/\%.") SELECT "value" FROM alltypessmall LIMIT 1;
----- SETUP
-RESET insert_string_partitioned
-DROP PARTITIONS insert_string_partitioned
+truncate insert_string_partitioned;
+INSERT INTO TABLE insert_string_partitioned PARTITION(s2="/\%.") SELECT "value" FROM functional.alltypessmall LIMIT 1;
 ---- RESULTS
 s2=%2F%5C%25./: 1
 ====
@@ -456,10 +448,9 @@ string, string
 ---- QUERY
 # static partition insert into string-partitioned table with non-escaped special characters
 # (Hive chooses not to escape + and ' ')
+truncate insert_string_partitioned;
 INSERT INTO TABLE insert_string_partitioned PARTITION(s2="_.~ +")
-SELECT "value" FROM alltypessmall LIMIT 1;
----- SETUP
-DROP PARTITIONS insert_string_partitioned
+SELECT "value" FROM functional.alltypessmall LIMIT 1;
 ---- RESULTS
 s2=_.~ +/: 1
 ====
@@ -473,31 +464,30 @@ string, string
 ====
 ---- QUERY
 # static partition insert into string-partitioned table with empty partition key
+truncate insert_string_partitioned;
 INSERT INTO TABLE insert_string_partitioned PARTITION(s2='')
-SELECT "value1" FROM alltypessmall LIMIT 1;
----- SETUP
-DROP PARTITIONS insert_string_partitioned
+SELECT "value1" FROM functional.alltypessmall LIMIT 1;
 ---- RESULTS
 s2=__HIVE_DEFAULT_PARTITION__/: 1
 ====
 ---- QUERY
 # dynamic partition insert into string-partitioned table with empty partition key
 INSERT INTO TABLE insert_string_partitioned PARTITION(s2)
-SELECT "value2","" FROM alltypessmall LIMIT 1;
+SELECT "value2","" FROM functional.alltypessmall LIMIT 1;
 ---- RESULTS
 s2=__HIVE_DEFAULT_PARTITION__/: 1
 ====
 ---- QUERY
 # static partition insert into string-partitioned table with NULL partition key
 INSERT INTO TABLE insert_string_partitioned PARTITION(s2=NULL)
-SELECT "value3" FROM alltypessmall LIMIT 1;
+SELECT "value3" FROM functional.alltypessmall LIMIT 1;
 ---- RESULTS
 s2=__HIVE_DEFAULT_PARTITION__/: 1
 ====
 ---- QUERY
 # dynamic partition insert into string-partitioned table with NULL partition key
 INSERT INTO TABLE insert_string_partitioned PARTITION(s2)
-SELECT "value4",NULL FROM alltypessmall LIMIT 1;
+SELECT "value4",NULL FROM functional.alltypessmall LIMIT 1;
 ---- RESULTS
 s2=__HIVE_DEFAULT_PARTITION__/: 1
 ====
@@ -523,22 +513,20 @@ string, string
 ====
 ---- QUERY
 # static partition insert with constant exprs as partition-key values
+truncate alltypesinsert;
 insert into alltypesinsert partition(year=cast(100*20+10 as int), month=cast(2*2 as int))
 select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col,
-double_col, date_string_col, string_col, timestamp_col from alltypessmall where month = 4
----- SETUP
-RESET alltypesinsert
+double_col, date_string_col, string_col, timestamp_col from functional.alltypessmall where month = 4
 ---- RESULTS
 year=2010/month=4/: 25
 ====
 ---- QUERY
 # static partition insert from a constant select
+truncate alltypesinsert;
 insert into alltypesinsert
 partition(year=2010, month=4)
 select 100, false, 1, 1, 1, 10,
 10.0, 10.0, "02/01/09", "1", cast("2009-02-01 00:01:00" as timestamp)
----- SETUP
-RESET alltypesinsert
 ---- RESULTS
 year=2010/month=4/: 1
 ====
@@ -562,13 +550,12 @@ int, boolean, tinyint, smallint, int, bigint, float, double, string, string, tim
 ====
 ---- QUERY
 # static partition insert from values statement
+truncate alltypesinsert;
 insert into alltypesinsert
 partition(year=2010, month=4) values
 (1, false, 1, 1, 1, 10, NULL, 10.0, "02/01/09", "1", cast("2009-02-01 00:01:00" as timestamp)),
 (2, true, 2, NULL, 2, 20, 20.0, 20.0, "02/02/09", "2", NULL),
 (3, false, 3, 3, 3, 30, 30.0, 30.0, "02/03/09", NULL, cast("2009-02-03 00:01:00" as timestamp))
----- SETUP
-RESET alltypesinsert
 ---- RESULTS
 year=2010/month=4/: 3
 ====
@@ -598,10 +585,9 @@ INT, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, STRING, STRING, TIM
 ====
 ---- QUERY
 # Test with clause in an insert statement.
-with t1 as (select * from alltypestiny)
+truncate alltypesinsert;
+with t1 as (select * from functional.alltypestiny)
 insert into alltypesinsert partition(year, month) select * from t1
----- SETUP
-RESET alltypesinsert
 ---- RESULTS
 year=2009/month=1/: 2
 year=2009/month=2/: 2
@@ -610,12 +596,11 @@ year=2009/month=4/: 2
 ====
 ---- QUERY
 # Test with clause in an insert statement and in its query statement.
-with t1 as (select * from alltypestiny)
+truncate alltypesinsert;
+with t1 as (select * from functional.alltypestiny)
 insert into alltypesinsert partition(year, month)
-with t2 as (select * from alltypestiny)
+with t2 as (select * from functional.alltypestiny)
 select * from t1 union all select * from t2
----- SETUP
-RESET alltypesinsert
 ---- RESULTS
 year=2009/month=1/: 4
 year=2009/month=2/: 4
@@ -626,7 +611,7 @@ year=2009/month=4/: 4
 # Test inserting NULLs for all types
 insert overwrite table alltypesnopart_insert
 select NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-from alltypessmall limit 10
+from functional.alltypessmall limit 10
 ---- RESULTS
 : 10
 ====
@@ -652,8 +637,6 @@ int, boolean, tinyint, smallint, int, bigint, float, double, string, string, tim
 insert overwrite alltypesnopart_insert(float_col, double_col)
 values(CAST(1/0 AS FLOAT), 1/0), (CAST(-1/0 AS FLOAT), -1/0),
       (CAST(0/0 AS FLOAT), 0/0), (CAST(-sqrt(-1) AS FLOAT), -sqrt(-1))
----- SETUP
-RESET alltypesinsert
 ---- RESULTS
 : 4
 ====
@@ -671,18 +654,19 @@ order by float_col, double_col limit 10;
 STRING, STRING
 ====
 ---- QUERY
-# Test that insert overwrite with a limit 0 clears the table.
+# Test that insert overwrite with dinamic partitioning with no partition value and a
+# limit 0 don't clears the table.
 insert overwrite table alltypesinsert
 partition (year, month)
 select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
 float_col, double_col, date_string_col, string_col, timestamp_col, year, month
-from alltypessmall limit 0
+from functional.alltypessmall limit 0
 ---- RESULTS
 ====
 ---- QUERY
 select count(*) from alltypesinsert
 ---- RESULTS
-0
+16
 ---- TYPES
 BIGINT
 ====
@@ -690,7 +674,7 @@ BIGINT
 # Test that insert overwrite with a limit 0 clears the table.
 insert overwrite table alltypesnopart_insert
 select 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-from alltypessmall limit 0
+from functional.alltypessmall limit 0
 ---- RESULTS
 : 0
 ====
@@ -752,9 +736,8 @@ INT, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, STRING, STRING, TIM
 ====
 ---- QUERY
 # IMPALA-1740: Test inserting into table with the skip.header.line.count tblproperty
+truncate table_with_header_insert;
 insert into table_with_header_insert values (1), (2), (3), (4);
----- SETUP
-RESET table_with_header_insert
 ---- RESULTS
 : 4
 ====
@@ -770,17 +753,15 @@ INT
 ====
 ---- QUERY
 # The following 4 queries are to test IMPALA-3452 which test S3 INSERTs with staging.
+truncate alltypesinsert;
 SET S3_SKIP_INSERT_STAGING=false;
 # static partition overwrite
 insert overwrite table alltypesinsert
 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 alltypessmall
+from functional.alltypessmall
 where year=2009 and month=4
----- SETUP
-DROP PARTITIONS alltypesinsert
-RESET alltypesinsert
 ---- RESULTS
 year=2009/month=4/: 25
 ====
@@ -820,15 +801,14 @@ where year=2009 and month=4
 int, boolean, tinyint, smallint, int, bigint, float, double, string, string
 ====
 ---- QUERY
+truncate alltypesinsert;
 SET S3_SKIP_INSERT_STAGING=false;
 # fully dynamic partition insert$TABLE, check partition creation
 insert into table alltypesinsert
 partition (year, month)
 select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
 float_col, double_col, date_string_col, string_col, timestamp_col, year, month
-from alltypessmall
----- SETUP
-DROP PARTITIONS alltypesinsert
+from functional.alltypessmall
 ---- RESULTS
 year=2009/month=1/: 25
 year=2009/month=2/: 25
@@ -846,12 +826,10 @@ bigint
 ====
 ---- QUERY
 # IMPALA-5293: noclustered insert into table
+truncate alltypesinsert;
 insert into table alltypesinsert
 partition (year, month) /*+ noclustered,shuffle */
-select * from alltypes;
----- SETUP
-DROP PARTITIONS alltypesinsert
-RESET alltypesinsert
+select * from functional.alltypes;
 ---- RESULTS
 year=2009/month=1/: 310
 year=2009/month=10/: 310
@@ -880,12 +858,10 @@ year=2010/month=9/: 300
 ====
 ---- QUERY
 # IMPALA-5293: noclustered insert into table
+truncate alltypesinsert;
 insert into table alltypesinsert
 partition (year, month) /*+ noclustered,shuffle */
-select * from alltypestiny;
----- SETUP
-DROP PARTITIONS alltypesinsert
-RESET alltypesinsert
+select * from functional.alltypestiny;
 ---- RESULTS
 year=2009/month=1/: 2
 year=2009/month=2/: 2
@@ -894,12 +870,10 @@ year=2009/month=4/: 2
 ====
 ---- QUERY
 # IMPALA-5293: noclustered insert into table
+truncate alltypesinsert;
 insert into table alltypesinsert
 partition (year, month) /*+ noclustered,noshuffle */
-select * from alltypestiny;
----- SETUP
-DROP PARTITIONS alltypesinsert
-RESET alltypesinsert
+select * from functional.alltypestiny;
 ---- RESULTS
 year=2009/month=1/: 2
 year=2009/month=2/: 2
@@ -908,12 +882,10 @@ year=2009/month=4/: 2
 ====
 ---- QUERY
 # IMPALA-5293: noclustered insert into table
+truncate alltypesinsert;
 insert into table alltypesinsert
 partition (year, month) /*+ noclustered,shuffle */
-select * from alltypestiny where int_col = 0;
----- SETUP
-DROP PARTITIONS alltypesinsert
-RESET alltypesinsert
+select * from functional.alltypestiny where int_col = 0;
 ---- RESULTS
 year=2009/month=1/: 1
 year=2009/month=2/: 1
@@ -922,12 +894,11 @@ year=2009/month=4/: 1
 ====
 ---- QUERY
 # IMPALA-5293: noclustered, unpartitioned insert into table
+truncate alltypesnopart_insert;
 insert into table alltypesnopart_insert
  /*+ noclustered,shuffle */
 select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col,
-double_col, date_string_col, string_col, timestamp_col from alltypessmall;
----- SETUP
-RESET alltypesnopart_insert
+double_col, date_string_col, string_col, timestamp_col from functional.alltypessmall;
 ---- RESULTS
 : 100
 ====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/insert_bad_expr.test b/testdata/workloads/functional-query/queries/QueryTest/insert_bad_expr.test
index 43edb36..7021ff3 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/insert_bad_expr.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/insert_bad_expr.test
@@ -1,5 +1,8 @@
 ====
 ---- QUERY
+create table insert_overwrite_nopart like functional.insert_overwrite_nopart;
+====
+---- QUERY
 # This test is run with codegen disabled. Interpretation only handles up to 20 arguments.
 create function if not exists twenty_one_args(int, int, int, int, int, int,
     int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) returns int
@@ -11,7 +14,7 @@ symbol='TwentyOneArgs';
 ---- QUERY
 # Regression test for IMPALA-6262: failure to initialize the output expressions
 # of data sink shouldn't crash Impalad.
-insert overwrite table functional.insert_overwrite_nopart
+insert overwrite table insert_overwrite_nopart
 select twenty_one_args(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,tinyint_col,
     case when rand() > 0.5 then 20 else 0 end)
 from functional.alltypessmall;
@@ -24,4 +27,3 @@ drop function twenty_one_args(int, int, int, int, int, int, int, int,
 ---- RESULTS
 'Function has been dropped.'
 ====
-
diff --git a/testdata/workloads/functional-query/queries/QueryTest/insert_null.test b/testdata/workloads/functional-query/queries/QueryTest/insert_null.test
index 78a8783..46a0c83 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/insert_null.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/insert_null.test
@@ -1,10 +1,26 @@
 ====
 ---- QUERY
+CREATE TABLE nullinsert (
+  str_col1 string,
+  str_col2 string,
+  str_col3 string,
+  str_col4 string,
+  int_cal int
+)
+row format delimited fields terminated by ','  escaped by '\\'
+LOCATION '$FILESYSTEM_PREFIX/test-warehouse/$DATABASE.db/nullinsert';
+CREATE EXTERNAL TABLE nullinsert_alt(
+  whole_row string
+)
+row format delimited fields terminated by '|'
+LOCATION '$FILESYSTEM_PREFIX/test-warehouse/$DATABASE.db/nullinsert';
+create table alltypesinsert like functional.alltypesinsert;
+create table nullformat_custom like functional.nullformat_custom;
+====
+---- QUERY
 # Test that we properly write null values to text tables.
 insert overwrite table nullinsert
-select NULL, "", "NULL", "\\N", NULL from alltypes limit 1
----- SETUP
-RESET nullinsert
+select NULL, "", "NULL", "\\N", NULL from functional.alltypes limit 1
 ---- RESULTS
 : 1
 ====
@@ -17,8 +33,6 @@ string, string, string, string, int
 ====
 ---- QUERY
 select * from nullinsert_alt
----- SETUP
-RESET nullinsert_alt
 ---- RESULTS
 '\\N,,NULL,\\\\N,\\N'
 ---- TYPES
@@ -26,14 +40,13 @@ string
 ====
 ---- QUERY
 # Test NULL partition keys using static partition insert. Both partitions keys are NULL.
+truncate alltypesinsert;
 insert overwrite table alltypesinsert
 partition(year=NULL, month=NULL)
-select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, 
+select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
 float_col, double_col, date_string_col, string_col, timestamp_col
-from alltypessmall
+from functional.alltypessmall
 where year=2009 and month=4
----- SETUP
-DROP PARTITIONS alltypesinsert
 ---- RESULTS
 year=__HIVE_DEFAULT_PARTITION__/month=__HIVE_DEFAULT_PARTITION__/: 25
 ====
@@ -46,24 +59,22 @@ select count(*) from alltypesinsert where year is null and month is null
 bigint
 ====
 ---- QUERY
-# Verify that dropping NULL partitions works in the SETUP section.
+# Verify that truncate NULL
+truncate alltypesinsert;
 select * from alltypesinsert
----- SETUP
-DROP PARTITIONS alltypesinsert
 ---- RESULTS
 ---- TYPES
 int, boolean, tinyint, smallint, int, bigint, float, double, string, string, timestamp, int, int
 ====
 ---- QUERY
 # Test NULL partition keys using static partition insert. Year partition key is NULL.
+truncate alltypesinsert;
 insert overwrite table alltypesinsert
 partition(year=NULL, month=10)
-select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, 
+select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
 float_col, double_col, date_string_col, string_col, timestamp_col
-from alltypessmall
+from functional.alltypessmall
 where year=2009 and month=4
----- SETUP
-DROP PARTITIONS alltypesinsert
 ---- RESULTS
 year=__HIVE_DEFAULT_PARTITION__/month=10/: 25
 ====
@@ -77,14 +88,13 @@ bigint
 ====
 ---- QUERY
 # Test NULL partition keys using dynamic partition insert. Month partition key is NULL.
+truncate alltypesinsert;
 insert overwrite table alltypesinsert
 partition(year=2008, month=NULL)
-select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, 
+select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
 float_col, double_col, date_string_col, string_col, timestamp_col
-from alltypessmall
+from functional.alltypessmall
 where year=2009 and month=4
----- SETUP
-DROP PARTITIONS alltypesinsert
 ---- RESULTS
 year=2008/month=__HIVE_DEFAULT_PARTITION__/: 25
 ====
@@ -100,10 +110,10 @@ bigint
 # Test NULL partition keys using dynamic partition insert.
 insert overwrite table alltypesinsert
 partition(year, month)
-select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, 
+select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
 float_col, double_col, date_string_col, string_col, timestamp_col,
 cast(if(bool_col, NULL, 2007) as int) as year, cast(if(tinyint_col % 3 = 0, NULL, 6) as int) as month
-from alltypessmall
+from functional.alltypessmall
 where year=2009 and month=4
 ---- RESULTS: VERIFY_IS_EQUAL_SORTED
 year=2007/month=6/: 8
diff --git a/testdata/workloads/functional-query/queries/QueryTest/insert_overwrite.test b/testdata/workloads/functional-query/queries/QueryTest/insert_overwrite.test
index 427513a..58162ae 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/insert_overwrite.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/insert_overwrite.test
@@ -1,11 +1,13 @@
 ====
 ---- QUERY
+create table insert_overwrite_nopart like functional.insert_overwrite_nopart;
+create table insert_overwrite_partitioned like functional.insert_overwrite_partitioned;
+====
+---- QUERY
 # insert overwrite into unpartitioned table
 insert overwrite table insert_overwrite_nopart 
 select int_col
-from tinyinttable
----- SETUP
-RESET insert_overwrite_nopart
+from functional.tinyinttable
 ---- RESULTS
 : 10
 ====
@@ -33,7 +35,7 @@ int
 # Now do an overwrite that should delete what was just written
 insert overwrite table insert_overwrite_nopart
 select 10
-from tinyinttable
+from functional.tinyinttable
 ---- RESULTS
 : 10
 ====
@@ -60,7 +62,7 @@ int
 ---- QUERY
 insert overwrite table insert_overwrite_nopart
 select 3
-from tinyinttable
+from functional.tinyinttable
 limit 0
 ---- RESULTS
 : 0
@@ -77,9 +79,7 @@ bigint
 insert overwrite table insert_overwrite_partitioned
 PARTITION(col2=5)
 select int_col
-from tinyinttable
----- SETUP
-RESET insert_overwrite_partitioned
+from functional.tinyinttable
 ---- RESULTS
 col2=5/: 10
 ====
@@ -107,9 +107,7 @@ int,int
 insert overwrite table insert_overwrite_partitioned
 PARTITION(col2=6)
 select int_col
-from tinyinttable
----- SETUP
-RESET insert_overwrite_nopart
+from functional.tinyinttable
 ---- RESULTS
 col2=6/: 10
 ====
@@ -147,7 +145,7 @@ int,int
 # Overwrite one partition, check that the other partition remains intact
 insert overwrite table insert_overwrite_partitioned
 partition(col2=5)
-select 10 from tinyinttable
+select 10 from functional.tinyinttable
 ---- RESULTS
 col2=5/: 10
 ====
@@ -184,9 +182,7 @@ int,int
 insert overwrite table insert_overwrite_partitioned
 partition(col2)
 select int_col, int_col 
-from tinyinttable
----- SETUP
-DROP PARTITIONS insert_overwrite_partitioned
+from functional.tinyinttable
 ---- RESULTS
 col2=0/: 1
 col2=1/: 1
@@ -223,7 +219,7 @@ int,int
 # Overwrite dynamic partition. Limit to 1 row without actually using limit, which forces non-parallel insert
 insert overwrite table insert_overwrite_partitioned
 partition(col2)
-select 10, 0 from tinyinttable
+select 10, 0 from functional.tinyinttable
 where int_col = 0
 ---- RESULTS
 col2=0/: 1
diff --git a/testdata/workloads/functional-query/queries/QueryTest/insert_permutation.test b/testdata/workloads/functional-query/queries/QueryTest/insert_permutation.test
index 696644f..5fcdaf0 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/insert_permutation.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/insert_permutation.test
@@ -18,10 +18,9 @@ partitioned by (p1 int, p2 string) stored as parquet;
 'Table has been created.'
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_nopart;
 # Simple non-permutation
 insert into perm_nopart(int_col1, string_col, int_col2) values(1,'str',2)
----- SETUP
-RESET insert_permutation_test.perm_nopart
 ---- RESULTS
 : 1
 ====
@@ -33,10 +32,9 @@ select * from perm_nopart
 INT,STRING,INT
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_nopart;
 # Permute the int columns
 insert into perm_nopart(int_col2, string_col, int_col1) values(1,'str',2)
----- SETUP
-RESET insert_permutation_test.perm_nopart
 ---- RESULTS
 : 1
 ====
@@ -48,10 +46,9 @@ select * from perm_nopart
 INT,STRING,INT
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_nopart;
 # Leave out two columns, check they are assigned NULL
 insert into perm_nopart(int_col2) values(1)
----- SETUP
-RESET insert_permutation_test.perm_nopart
 ---- RESULTS
 : 1
 ====
@@ -63,10 +60,9 @@ NULL,'NULL',1
 INT,STRING,INT
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_part;
 # Permute the partition columns
 insert into perm_part(p1, string_col, int_col1, p2) values(10,'str',1, 'hello')
----- SETUP
-RESET insert_permutation_test.perm_part
 ---- RESULTS
 p1=10/p2=hello/: 1
 ====
@@ -78,10 +74,9 @@ select * from perm_part
 INT,STRING,INT,STRING
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_part;
 # Same thing - permute the partition columns, but invert their order relative to Hive
 insert into perm_part(p2, string_col, int_col1, p1) values('hello','str',1, 10)
----- SETUP
-RESET insert_permutation_test.perm_part
 ---- RESULTS
 p1=10/p2=hello/: 1
 ====
@@ -93,10 +88,9 @@ select * from perm_part
 INT,STRING,INT,STRING
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_part;
 # Check NULL if only partition keys are mentioned
 insert into perm_part(p2, p1) values('hello', 10)
----- SETUP
-RESET insert_permutation_test.perm_part
 ---- RESULTS
 p1=10/p2=hello/: 1
 ====
@@ -108,10 +102,9 @@ NULL,'NULL',10,'hello'
 INT,STRING,INT,STRING
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_part;
 # Check NULL if only partition keys are mentioned, one static
 insert into perm_part(p2) PARTITION(p1=10) values('hello')
----- SETUP
-RESET insert_permutation_test.perm_part
 ---- RESULTS
 p1=10/p2=hello/: 1
 ====
@@ -123,11 +116,10 @@ NULL,'NULL',10,'hello'
 INT,STRING,INT,STRING
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_part;
 # Check dynamic keys mentioned in the PARTITION column are still looked for at the end of
 # the select-list
 insert into perm_part(int_col1, string_col) PARTITION(p1=10, p2) values(1,'perm_col','part_col')
----- SETUP
-RESET insert_permutation_test.perm_part
 ---- RESULTS
 p1=10/p2=part_col/: 1
 ====
@@ -139,10 +131,9 @@ select * from perm_part
 INT,STRING,INT,STRING
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_part;
 # Check behaviour of empty permutation clause with no query statement
 insert into perm_part() PARTITION(p1=10, p2='foo')
----- SETUP
-RESET insert_permutation_test.perm_part
 ---- RESULTS
 p1=10/p2=foo/: 1
 ====
@@ -154,10 +145,9 @@ NULL,'NULL',10,'foo'
 INT,STRING,INT,STRING
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_part;
 # Check behaviour of empty permutation clause
 insert into perm_part() PARTITION(p1, p2='foo') values(5)
----- SETUP
-RESET insert_permutation_test.perm_part
 ---- RESULTS
 p1=5/p2=foo/: 1
 ====
@@ -169,10 +159,9 @@ NULL,'NULL',5,'foo'
 INT,STRING,INT,STRING
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_nopart;
 # Check behaviour of empty permutation clause with unpartitioned table
 insert into perm_nopart()
----- SETUP
-RESET insert_permutation_test.perm_nopart
 ---- RESULTS
 : 1
 ====
@@ -198,11 +187,10 @@ NULL,'NULL',2,'foo'
 INT,STRING,INT,STRING
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_nopart;
 # Perform the same set of queries, but with SELECT clauses rather than VALUES
 # Simple non-permutation
 insert into perm_nopart(int_col1, string_col, int_col2) select 1,'str',2
----- SETUP
-RESET insert_permutation_test.perm_nopart
 ---- RESULTS
 : 1
 ====
@@ -214,10 +202,9 @@ select * from perm_nopart
 INT,STRING,INT
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_nopart;
 # Permute the int columns
 insert into perm_nopart(int_col2, string_col, int_col1) select 1,'str',2
----- SETUP
-RESET insert_permutation_test.perm_nopart
 ---- RESULTS
 : 1
 ====
@@ -229,10 +216,9 @@ select * from perm_nopart
 INT,STRING,INT
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_nopart;
 # Leave out two columns, check they are assigned NULL
 insert into perm_nopart(int_col2) select 1
----- SETUP
-RESET insert_permutation_test.perm_nopart
 ---- RESULTS
 : 1
 ====
@@ -244,10 +230,9 @@ NULL,'NULL',1
 INT,STRING,INT
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_part;
 # Permute the partition columns
 insert into perm_part(p1, string_col, int_col1, p2) select 10,'str',1, 'hello'
----- SETUP
-RESET insert_permutation_test.perm_part
 ---- RESULTS
 p1=10/p2=hello/: 1
 ====
@@ -259,10 +244,10 @@ select * from perm_part
 INT,STRING,INT,STRING
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_part;
 # Same thing - permute the partition columns, but invert their order relative to Hive
 insert into perm_part(p2, string_col, int_col1, p1) select 'hello','str',1, 10
----- SETUP
-RESET insert_permutation_test.perm_part
+
 ---- RESULTS
 p1=10/p2=hello/: 1
 ====
@@ -274,10 +259,9 @@ select * from perm_part
 INT,STRING,INT,STRING
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_part;
 # Check NULL if only partition keys are mentioned
 insert into perm_part(p2, p1) select 'hello', 10
----- SETUP
-RESET insert_permutation_test.perm_part
 ---- RESULTS
 p1=10/p2=hello/: 1
 ====
@@ -289,10 +273,9 @@ NULL,'NULL',10,'hello'
 INT,STRING,INT,STRING
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_part;
 # Check NULL if only partition keys are mentioned, one static
 insert into perm_part(p2) PARTITION(p1=10) select 'hello'
----- SETUP
-RESET insert_permutation_test.perm_part
 ---- RESULTS
 p1=10/p2=hello/: 1
 ====
@@ -304,12 +287,11 @@ NULL,'NULL',10,'hello'
 INT,STRING,INT,STRING
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_nopart;
 # Now some queries that use SELECT FROM
 # Simple non-permutation
 insert into perm_nopart(int_col1, string_col, int_col2) select 1,'str',2 FROM
 functional.alltypes LIMIT 2
----- SETUP
-RESET insert_permutation_test.perm_nopart
 ---- RESULTS
 : 2
 ====
@@ -322,9 +304,8 @@ select * from perm_nopart
 INT,STRING,INT
 ====
 ---- QUERY
+truncate insert_permutation_test.perm_nopart;
 insert into perm_nopart(int_col1) select id FROM functional.alltypes ORDER BY ID LIMIT 2
----- SETUP
-RESET insert_permutation_test.perm_nopart
 ---- RESULTS
 : 2
 ====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/load.test b/testdata/workloads/functional-query/queries/QueryTest/load.test
index 4528380..c9af269 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/load.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/load.test
@@ -148,11 +148,8 @@ select count(*) from functional.test_load_nopart
 BIGINT
 ====
 ---- QUERY
+truncate functional.test_load;
 select count(*) from functional.test_load where year=2010 and month=1
----- SETUP
-# A refresh needs to happen before selecting from this table because file(s) changed
-# underneath it.
-RESET functional.test_load
 ---- RESULTS
 0
 ---- TYPES
diff --git a/testdata/workloads/functional-query/queries/QueryTest/show.test b/testdata/workloads/functional-query/queries/QueryTest/show.test
index 1c8bb48..6187857 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/show.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/show.test
@@ -74,8 +74,6 @@ show tables '*'
 'jointbl'
 'liketbl'
 'nullescapedtable'
-'nullinsert'
-'nullinsert_alt'
 'nulltable'
 'rankingssmall'
 'stringpartitionkey'
@@ -125,8 +123,6 @@ show tables in functional
 'jointbl'
 'liketbl'
 'nullescapedtable'
-'nullinsert'
-'nullinsert_alt'
 'nulltable'
 'overflow'
 'rankingssmall'
diff --git a/tests/common/impala_test_suite.py b/tests/common/impala_test_suite.py
index aea3611..51060b0 100644
--- a/tests/common/impala_test_suite.py
+++ b/tests/common/impala_test_suite.py
@@ -644,9 +644,6 @@ class ImpalaTestSuite(BaseTestSuite):
             '-- QUERY or HIVE_QUERY section.\n%s') %\
             (test_file_name, pprint.pformat(test_section))
 
-      if 'SETUP' in test_section:
-        self.execute_test_case_setup(test_section['SETUP'], table_format_info)
-
       # TODO: support running query tests against different scale factors
       query = QueryTestSectionReader.build_query(
           self.__do_replacements(query_section, use_db=use_db, extra=test_file_vars))
@@ -767,32 +764,6 @@ class ImpalaTestSuite(BaseTestSuite):
             return lineage
     return ""
 
-  def execute_test_case_setup(self, setup_section, table_format):
-    """
-    Executes a test case 'SETUP' section
-
-    The test case 'SETUP' section is mainly used for insert tests. These tests need to
-    have some actions performed before each test case to ensure the target tables are
-    empty. The current supported setup actions:
-    RESET <table name> - Drop and recreate the table
-    DROP PARTITIONS <table name> - Drop all partitions from the table
-    """
-    setup_section = QueryTestSectionReader.build_query(setup_section)
-    for row in setup_section.split('\n'):
-      row = row.lstrip()
-      if row.startswith('RESET'):
-        db_name, table_name = QueryTestSectionReader.get_table_name_components(\
-          table_format, row.split('RESET')[1])
-        self.__reset_table(db_name, table_name)
-        self.client.execute("invalidate metadata " + db_name + "." + table_name)
-      elif row.startswith('DROP PARTITIONS'):
-        db_name, table_name = QueryTestSectionReader.get_table_name_components(\
-          table_format, row.split('DROP PARTITIONS')[1])
-        self.__drop_partitions(db_name, table_name)
-        self.client.execute("invalidate metadata " + db_name + "." + table_name)
-      else:
-        assert False, 'Unsupported setup command: %s' % row
-
   @classmethod
   def change_database(cls, impala_client, table_format=None,
       db_name=None, scale_factor=None):
@@ -921,25 +892,12 @@ class ImpalaTestSuite(BaseTestSuite):
       assert False, 'Test file not found: %s' % file_name
     return parse_query_test_file(test_file_path, valid_section_names, encoding=encoding)
 
-  def __drop_partitions(self, db_name, table_name):
-    """Drops all partitions in the given table"""
-    for partition in self.hive_client.get_partition_names(db_name, table_name, -1):
-      assert self.hive_client.drop_partition_by_name(db_name, table_name, \
-          partition, True), 'Could not drop partition: %s' % partition
-
   @classmethod
   def __execute_query(cls, impalad_client, query, query_options=None, user=None):
     """Executes the given query against the specified Impalad"""
     if query_options is not None: impalad_client.set_configuration(query_options)
     return impalad_client.execute(query, user=user)
 
-  def __reset_table(self, db_name, table_name):
-    """Resets a table (drops and recreates the table)"""
-    table = self.hive_client.get_table(db_name, table_name)
-    assert table is not None
-    self.hive_client.drop_table(db_name, table_name, True)
-    self.hive_client.create_table(table)
-
   def clone_table(self, src_tbl, dst_tbl, recover_partitions, vector):
     src_loc = self._get_table_location(src_tbl, vector)
     self.client.execute("create external table {0} like {1} location '{2}'"\
diff --git a/tests/custom_cluster/test_mt_dop.py b/tests/custom_cluster/test_mt_dop.py
index b1c6172..232bb45 100644
--- a/tests/custom_cluster/test_mt_dop.py
+++ b/tests/custom_cluster/test_mt_dop.py
@@ -34,7 +34,6 @@ class TestMtDopFlags(CustomClusterTestSuite):
   def add_test_dimensions(cls):
     super(TestMtDopFlags, cls).add_test_dimensions()
 
-  @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(impalad_args="--mt_dop_auto_fallback=true")
   @SkipIfNotHdfsMinicluster.tuned_for_minicluster
   def test_mt_dop_fallback(self, vector, unique_database):
@@ -49,7 +48,7 @@ class TestMtDopFlags(CustomClusterTestSuite):
 
     # Check that the join and insert plans work as expected.
     self.run_test_case('QueryTest/joins', vector, use_db="functional_parquet")
-    self.run_test_case('QueryTest/insert', vector)
+    self.run_test_case('QueryTest/insert', vector, unique_database)
 
   @CustomClusterTestSuite.with_args(impalad_args="--unlock_mt_dop=true", cluster_size=1)
   def test_mt_dop_runtime_filters_one_node(self, vector):
diff --git a/tests/query_test/test_insert.py b/tests/query_test/test_insert.py
index edbf853..3223377 100644
--- a/tests/query_test/test_insert.py
+++ b/tests/query_test/test_insert.py
@@ -79,7 +79,6 @@ class TestInsertQueries(ImpalaTestSuite):
             (v.get_value('table_format').file_format == 'parquet' and \
             v.get_value('compression_codec') == 'none'))
 
-  @pytest.mark.execute_serially
   def test_insert_large_string(self, vector, unique_database):
     """Test handling of large strings in inserter and scanner."""
     if "-Xcheck:jni" in os.environ.get("LIBHDFS_OPTS", ""):
@@ -125,16 +124,15 @@ class TestInsertQueries(ImpalaTestSuite):
   def setup_class(cls):
     super(TestInsertQueries, cls).setup_class()
 
-  @pytest.mark.execute_serially
   # Erasure coding doesn't respect memory limit
   @SkipIfEC.fix_later
   # ABFS partition names cannot end in periods
   @SkipIfABFS.file_or_folder_name_ends_with_period
-  def test_insert(self, vector):
+  def test_insert(self, vector, unique_database):
     if (vector.get_value('table_format').file_format == 'parquet'):
       vector.get_value('exec_option')['COMPRESSION_CODEC'] = \
           vector.get_value('compression_codec')
-    self.run_test_case('QueryTest/insert', vector,
+    self.run_test_case('QueryTest/insert', vector, unique_database,
         multiple_impalad=vector.get_value('exec_option')['sync_ddl'] == 1)
 
   @SkipIfHive2.acid
@@ -162,11 +160,11 @@ class TestInsertQueries(ImpalaTestSuite):
 
   @pytest.mark.execute_serially
   @SkipIfNotHdfsMinicluster.tuned_for_minicluster
-  def test_insert_mem_limit(self, vector):
+  def test_insert_mem_limit(self, vector, unique_database):
     if (vector.get_value('table_format').file_format == 'parquet'):
       vector.get_value('exec_option')['COMPRESSION_CODEC'] = \
           vector.get_value('compression_codec')
-    self.run_test_case('QueryTest/insert-mem-limit', vector,
+    self.run_test_case('QueryTest/insert-mem-limit', vector, unique_database,
         multiple_impalad=vector.get_value('exec_option')['sync_ddl'] == 1)
     # IMPALA-7023: These queries can linger and use up memory, causing subsequent
     # tests to hit memory limits. Wait for some time to allow the query to
@@ -176,18 +174,16 @@ class TestInsertQueries(ImpalaTestSuite):
     for v in verifiers:
       v.wait_for_metric("impala-server.num-fragments-in-flight", 0, timeout=180)
 
-  @pytest.mark.execute_serially
   @SkipIfS3.eventually_consistent
-  def test_insert_overwrite(self, vector):
-    self.run_test_case('QueryTest/insert_overwrite', vector,
+  def test_insert_overwrite(self, vector, unique_database):
+    self.run_test_case('QueryTest/insert_overwrite', vector, unique_database,
         multiple_impalad=vector.get_value('exec_option')['sync_ddl'] == 1)
 
-  @pytest.mark.execute_serially
-  def test_insert_bad_expr(self, vector):
+  def test_insert_bad_expr(self, vector, unique_database):
     # The test currently relies on codegen being disabled to trigger an error in
     # the output expression of the table sink.
     if vector.get_value('exec_option')['disable_codegen']:
-      self.run_test_case('QueryTest/insert_bad_expr', vector,
+      self.run_test_case('QueryTest/insert_bad_expr', vector, unique_database,
           multiple_impalad=vector.get_value('exec_option')['sync_ddl'] == 1)
 
   @UniqueDatabase.parametrize(sync_ddl=True)
@@ -306,9 +302,8 @@ class TestInsertNullQueries(ImpalaTestSuite):
   def setup_class(cls):
     super(TestInsertNullQueries, cls).setup_class()
 
-  @pytest.mark.execute_serially
-  def test_insert_null(self, vector):
-    self.run_test_case('QueryTest/insert_null', vector)
+  def test_insert_null(self, vector, unique_database):
+    self.run_test_case('QueryTest/insert_null', vector, unique_database)
 
 
 class TestInsertFileExtension(ImpalaTestSuite):
diff --git a/tests/query_test/test_mt_dop.py b/tests/query_test/test_mt_dop.py
index f1e5d32..da32e6f 100644
--- a/tests/query_test/test_mt_dop.py
+++ b/tests/query_test/test_mt_dop.py
@@ -121,14 +121,13 @@ class TestMtDopParquet(ImpalaTestSuite):
     vector.get_value('exec_option')['parquet_read_statistics'] = '0'
     self.run_test_case('QueryTest/parquet-filtering', vector)
 
-  @pytest.mark.execute_serially
   @SkipIfABFS.file_or_folder_name_ends_with_period
   def test_mt_dop_insert(self, vector, unique_database):
     """Basic tests for inserts with mt_dop > 0"""
     mt_dop = vector.get_value('mt_dop')
     if mt_dop == 0:
       pytest.skip("Non-mt inserts tested elsewhere")
-    self.run_test_case('QueryTest/insert', vector)
+    self.run_test_case('QueryTest/insert', vector, unique_database)
 
   def test_mt_dop_only_joins(self, vector, unique_database):
     """MT_DOP specific tests for joins."""
@@ -173,4 +172,3 @@ class TestMtDopScheduling(ImpalaTestSuite):
   def test_scheduling(self, vector):
     vector.get_value('exec_option')['mt_dop'] = vector.get_value('mt_dop')
     self.run_test_case('QueryTest/mt-dop-parquet-scheduling', vector)
-