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

amashenkov pushed a commit to branch ignite-12747
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-12747 by this push:
     new ae4dcf2  Add tests.
ae4dcf2 is described below

commit ae4dcf28e016cc11691f1a232444f4a9880bc5fc
Author: Andrew V. Mashenkov <andrey.mashen...@gmail.com>
AuthorDate: Wed Jun 17 19:40:23 2020 +0300

    Add tests.
---
 .../calcite/rules/SubqueryRewriteRuleTest.java     | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git 
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/SubqueryRewriteRuleTest.java
 
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/SubqueryRewriteRuleTest.java
index aaf4bff..e682d0d 100644
--- 
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/SubqueryRewriteRuleTest.java
+++ 
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/SubqueryRewriteRuleTest.java
@@ -190,7 +190,7 @@ public class SubqueryRewriteRuleTest extends 
GridCommonAbstractTest {
         checkQuery("SELECT c_custkey\n" +
             "FROM CUSTOMER\n" +
             "WHERE c_countrykey = 86 AND EXISTS(\n" +
-            "    SELECT * FROM ORDERS\n" +
+            "    SELECT 1 FROM ORDERS\n" +
             "    WHERE o_custkey = c_custkey \n" + // Correlated.
             ")")
             .and(QueryChecker.containsJoin("semi"))
@@ -217,6 +217,26 @@ public class SubqueryRewriteRuleTest extends 
GridCommonAbstractTest {
     }
 
     /**
+     * Check subquery rewrite rule is applied for correlated query.
+     *
+     * @throws Exception If failed.
+     */
+    @Ignore("https://issues.apache.org/jira/browse/IGNITE-13159";)
+    @Test
+    public void testNotExistsToAntiJoinRule() throws Exception {
+        checkQuery("SELECT c_custkey\n" +
+            "FROM CUSTOMER\n" +
+            "WHERE NOT EXISTS(\n" +
+            "    SELECT 1 FROM ORDERS\n" +
+            "    WHERE o_custkey = c_custkey \n" + // Correlated.
+            ")")
+            .and(QueryChecker.containsJoin("anti"))
+            .and(containsScan("PUBLIC", "CUSTOMER", "PK"))
+            .and(containsScan("PUBLIC", "ORDERS", "PK"))
+            .check();
+    }
+
+    /**
      * Check subquery rewrite rule is applied for non-correlated query.
      *
      * @throws Exception If failed.

Reply via email to