You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "JiajunBernoulli (via GitHub)" <gi...@apache.org> on 2023/04/29 03:40:42 UTC

[GitHub] [calcite] JiajunBernoulli commented on a diff in pull request #3182: [CALCITE-5680] Wrong plan for multiple IN sub-queries with only literal operands

JiajunBernoulli commented on code in PR #3182:
URL: https://github.com/apache/calcite/pull/3182#discussion_r1180947622


##########
core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java:
##########
@@ -6448,6 +6448,42 @@ private void checkSemiJoinRuleOnAntiJoin(RelOptRule rule) {
         .check();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-5680">[CALCITE-5680]
+   * Wrong field reference lookup due to same intermediate table alias
+   * of multiple sub-queries with only literal operands in subquery remove phase</a>. */
+  @Test void testExpandFilterConstantInCorrelatedWithTwoSubQueries() {
+    final String sql = "select empno from sales.empnullables as e\n"
+        + "where 1 in (\n"
+        + "  select deptno from sales.deptnullables where e.ename = name and deptno > 10)\n"
+        + "or 2 in (\n"
+        + "  select deptno from sales.deptnullables where e.ename = name and deptno < 20)";
+    System.out.println(sql);

Review Comment:
   `System.out.println(sql)` is redundant.



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org