This is an automated email from the ASF dual-hosted git repository. csringhofer pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit 60a7d6cb467f21b2c9659c3a6c504b1c49656a7b Author: Riza Suminto <[email protected]> AuthorDate: Thu Aug 29 11:17:11 2024 -0700 IMPALA-13343: Use unique_database in test_outer_joins TestTPCHJoinQueries.test_outer_joins run tpch-outer-joins.test, which drop/create table default.t1 and default.t2. If two test_outer_joins with different test vector run concurrently, one of them can hit error like "AnalysisException: Table already exists: default.t1". This patch change the test to use unique_database fixture and create both t1 and t2 table in that unique database. Testing: - Run and pass TestTPCHJoinQueries.test_outer_joins using bin/run-all-tests.sh and NUM_TEST_ITERATIONS=10. - Confirm that both t1 and t2 table are made within the unique database. Change-Id: I9a260663c0bf8d2740883836194933edf2b8cff5 Reviewed-on: http://gerrit.cloudera.org:8080/21737 Reviewed-by: Michael Smith <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- .../workloads/tpch/queries/tpch-outer-joins.test | 20 ++++++++++---------- tests/query_test/test_join_queries.py | 5 +++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/testdata/workloads/tpch/queries/tpch-outer-joins.test b/testdata/workloads/tpch/queries/tpch-outer-joins.test index e0e96f29e..32d7b23cc 100644 --- a/testdata/workloads/tpch/queries/tpch-outer-joins.test +++ b/testdata/workloads/tpch/queries/tpch-outer-joins.test @@ -63,20 +63,20 @@ BIGINT # Regression test for IMPALA-9338. The following query uses reserved key as columns, # and duplicates the same condition with different letter cases, should provide a # correct plan after the fix. -drop table if exists default.t1; -drop table if exists default.t2; -create table default.t1(`insert` bigint); -create table default.t2(`select` bigint); -insert into default.t1(`insert`) +drop table if exists $UNIQUE_DB.t1; +drop table if exists $UNIQUE_DB.t2; +create table $UNIQUE_DB.t1(`insert` bigint); +create table $UNIQUE_DB.t2(`select` bigint); +insert into $UNIQUE_DB.t1(`insert`) select c_custkey from tpch_parquet.customer limit 100; -insert into default.t2(`select`) +insert into $UNIQUE_DB.t2(`select`) select o_custkey from tpch_parquet.orders limit 100000; -explain select * from default.t1 b -left join default.t2 a +explain select * from $UNIQUE_DB.t1 b +left join $UNIQUE_DB.t2 a ON b.`insert` = a.`select` AND a.`SELECT` = b.`INSERT`; ---- RESULTS: VERIFY_IS_SUBSET @@ -84,7 +84,7 @@ AND a.`SELECT` = b.`INSERT`; '05:EXCHANGE [UNPARTITIONED]' '02:HASH JOIN [RIGHT OUTER JOIN, PARTITIONED]' '|--04:EXCHANGE [HASH(b.`INSERT`,b.`insert`)]' -'| 00:SCAN $FILESYSTEM_NAME [default.t1 b]' +'| 00:SCAN $FILESYSTEM_NAME [$UNIQUE_DB.t1 b]' '03:EXCHANGE [HASH(a.`SELECT`,a.`select`)]' -'01:SCAN $FILESYSTEM_NAME [default.t2 a]' +'01:SCAN $FILESYSTEM_NAME [$UNIQUE_DB.t2 a]' ==== diff --git a/tests/query_test/test_join_queries.py b/tests/query_test/test_join_queries.py index 2db2714fe..007de058c 100644 --- a/tests/query_test/test_join_queries.py +++ b/tests/query_test/test_join_queries.py @@ -175,8 +175,9 @@ class TestTPCHJoinQueries(TestJoinBase): cls.client.execute('set mem_limit = 0') super(TestTPCHJoinQueries, cls).teardown_class() - def test_outer_joins(self, vector): - self.run_test_case('tpch-outer-joins', vector) + def test_outer_joins(self, vector, unique_database): + self.run_test_case('tpch-outer-joins', vector, + test_file_vars={'$UNIQUE_DB': unique_database}) class TestSemiJoinQueries(TestJoinBase):
