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 2017/12/06 01:56:04 UTC

[7/8] impala git commit: IMPALA-6273: fixes subquery tests for functional_hbase

IMPALA-6273: fixes subquery tests for functional_hbase

IMPALA-1422 introduced tests that do not work with
the testing setup for hbase. Namely, tinyinttable is
not defined in the functional_hbase database, but
is defined in the functional database. Exhaustive
tests uncovered the issue.

This change makes two changes so that tests work with
functional_hbase:
1) use a table that is present in both functional and
   functional_hbase. the tests needed a subquery result
   with a single int column. tinyinttable is replaced
   with an inline view that provides this single int
   column in a portable manner.
2) nulls are handled differently with hbase (see IMPALA-728)
   so the nulltable used in the tests is set to
   functional.nulltable to avoid inconsistent results across
   input formats.

Testing:
- ran e2e tests with exhaustive exploration strategy for the
  broken test.

Change-Id: Ibaa3a3df7362ac6d3ed07aff133dc4b3520bb4e0
Reviewed-on: http://gerrit.cloudera.org:8080/8765
Reviewed-by: Dimitris Tsirogiannis <dt...@cloudera.com>
Tested-by: Impala Public Jenkins


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

Branch: refs/heads/master
Commit: 16c5f514e0315dfd63ee88d98d25099547e42cc4
Parents: e79f644
Author: Vuk Ercegovac <ve...@cloudera.com>
Authored: Tue Dec 5 10:13:32 2017 -0800
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Wed Dec 6 00:41:11 2017 +0000

----------------------------------------------------------------------
 .../QueryTest/subquery-in-constant-lhs.test     | 21 ++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/16c5f514/testdata/workloads/functional-query/queries/QueryTest/subquery-in-constant-lhs.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-query/queries/QueryTest/subquery-in-constant-lhs.test b/testdata/workloads/functional-query/queries/QueryTest/subquery-in-constant-lhs.test
index df9303b..56627cb 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/subquery-in-constant-lhs.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/subquery-in-constant-lhs.test
@@ -112,8 +112,7 @@ INT, INT, STRING
 ====
 ---- QUERY
 # LHS null, Predicate IN, RHS not-empty with match. Uncorrelated. Expect no results.
-SELECT count(*) FROM alltypessmall a
-WHERE NULL IN (SELECT d FROM nulltable);
+SELECT count(*) FROM alltypessmall a WHERE NULL IN (SELECT d FROM nulltable);
 ---- RESULTS
 0
 ---- TYPES
@@ -215,7 +214,7 @@ INT, INT, STRING
 ====
 ---- QUERY
 # LHS is non-null, Predicate is IN, RHS is an aggregate.
-SELECT count(*) FROM alltypessmall a WHERE 0 IN (SELECT MIN(int_col) from tinyinttable);
+SELECT count(*) FROM alltypessmall a WHERE 0 IN (SELECT MIN(int_col) from alltypestiny);
 ---- RESULTS
 100
 ---- TYPES
@@ -223,7 +222,7 @@ BIGINT
 ====
 ---- QUERY
 # LHS is non-null, Predicate is NOT IN, RHS is an aggregate.
-SELECT a.id FROM alltypessmall a WHERE 0 NOT IN (SELECT MIN(int_col) from tinyinttable);
+SELECT a.id FROM alltypessmall a WHERE 0 NOT IN (SELECT MIN(int_col) from alltypestiny);
 ---- RESULTS
 ---- TYPES
 INT
@@ -245,14 +244,18 @@ INT
 ====
 ---- QUERY
 # LHS is null, Predicate is NOT IN, RHS is group by without aggregation. Expect no results.
-SELECT a.id from alltypessmall a where NULL NOT IN (SELECT d from nulltable group by d);
+# Note: using functional.nulltable explicitly to avoid inconsistent results due to
+# different null handling across formats (specifically, hbase). See IMPALA-6276.
+SELECT a.id from alltypessmall a where
+NULL NOT IN (SELECT d from functional.nulltable group by d);
 ---- RESULTS
 ---- TYPES
 INT
 ====
 ---- QUERY
 # LHS is non-null, Predicate is IN, RHS is select list is "*".
-SELECT a.id FROM alltypessmall a WHERE 1 IN (SELECT * FROM tinyinttable) and a.id < 3;
+SELECT a.id FROM alltypessmall a WHERE
+1 IN (SELECT * FROM (select int_col from alltypestiny) tmp) and a.id < 3;
 ---- RESULTS
 0
 1
@@ -262,7 +265,8 @@ INT
 ====
 ---- QUERY
 # LHS is non-null, Predicate is NOT IN, RHS is select list is "*".
-SELECT a.id FROM alltypessmall a WHERE 1 NOT IN (SELECT * FROM tinyinttable);
+SELECT a.id FROM alltypessmall a WHERE
+1 NOT IN (SELECT * FROM (select int_col from alltypestiny) tmp);
 ---- RESULTS
 ---- TYPES
 INT
@@ -289,7 +293,8 @@ BIGINT
 ---- QUERY
 # LHS is non-null, Predicate is IN, RHS includes nested subqueries.
 SELECT a.id FROM alltypessmall a WHERE
-1 IN (SELECT int_col FROM alltypessmall WHERE -10000 IN (SELECT * FROM tinyinttable));
+1 IN (SELECT int_col FROM alltypessmall WHERE
+-10000 IN (SELECT * FROM (select int_col from alltypestiny) tmp));
 ---- RESULTS
 ---- TYPES
 INT