zabetak commented on code in PR #6572:
URL: https://github.com/apache/hive/pull/6572#discussion_r3493769628


##########
ql/src/test/queries/clientpositive/decorrelate_semi_join.q:
##########
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS `tab`;
+CREATE EXTERNAL TABLE `tab`(
+  `f1` string,
+  `f2` string,
+  `f3` string,
+  `f4` string,
+  `f5` string,
+  `f6` string);
+
+SELECT 1
+FROM tab a
+WHERE a.f4 IN ('1', '2')
+AND EXISTS (
+  SELECT 1
+  FROM tab b
+  WHERE  a.f6 = b.f1 AND b.f3 IN (SELECT 1)
+);

Review Comment:
   The query fails at compilation and the table has no data so it would be 
better to use EXPLAIN CBO to also assert a certain shape in the query plan than 
a plain empty result.



##########
ql/src/test/queries/clientpositive/decorrelate_semi_join.q:
##########
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS `tab`;

Review Comment:
   Cleanup is taken care by the test framework so we can skip the DROP command.



##########
ql/src/test/queries/clientpositive/decorrelate_semi_join.q:
##########
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS `tab`;
+CREATE EXTERNAL TABLE `tab`(
+  `f1` string,
+  `f2` string,
+  `f3` string,
+  `f4` string,
+  `f5` string,
+  `f6` string);
+
+SELECT 1
+FROM tab a
+WHERE a.f4 IN ('1', '2')

Review Comment:
   Does the  `a.f4 IN ('1', '2')` predicate adds something specific to the 
problem?



##########
ql/src/test/queries/clientpositive/decorrelate_semi_join.q:
##########
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS `tab`;
+CREATE EXTERNAL TABLE `tab`(
+  `f1` string,
+  `f2` string,
+  `f3` string,
+  `f4` string,
+  `f5` string,
+  `f6` string);
+
+SELECT 1
+FROM tab a
+WHERE a.f4 IN ('1', '2')
+AND EXISTS (
+  SELECT 1
+  FROM tab b
+  WHERE  a.f6 = b.f1 AND b.f3 IN (SELECT 1)
+);

Review Comment:
   In fact, I would be inclined to put this test case in the same file with 
`subquery_nested_corr.q` and use a schema with data such as the part table from 
TPC-H. Since we have no similar queries in our testing framework it would be 
useful to ensure that apart from the plan the query results are also correct.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to