You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/06/01 12:40:28 UTC

[GitHub] [ignite] alex-plekhanov commented on a change in pull request #9103: IGNITE-12747 Correlated queries support

alex-plekhanov commented on a change in pull request #9103:
URL: https://github.com/apache/ignite/pull/9103#discussion_r643046606



##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/FunctionsTest.java
##########
@@ -86,7 +86,9 @@ public void testRange() {
             "Increment can't be 0");
     }
 
-    /** */
+    /** Important! Don`t change query call sequence in this test. This also tests correctness of

Review comment:
       NL after `/**`

##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java
##########
@@ -1216,6 +1216,35 @@ public void testInfixTypeCast() {
         assertThat(qCur.fieldsMeta().get(3).fieldTypeName(), equalTo(String.class.getName()));
     }
 
+    @Test
+    public void quantifiedCompTest() throws InterruptedException {

Review comment:
       Javadoc required

##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java
##########
@@ -1216,6 +1216,35 @@ public void testInfixTypeCast() {
         assertThat(qCur.fieldsMeta().get(3).fieldTypeName(), equalTo(String.class.getName()));
     }
 
+    @Test
+    public void quantifiedCompTest() throws InterruptedException {
+        populateTables();
+
+        assertQuery(client, "select salary from account where salary > SOME (10, 11) ORDER BY salary")
+            .returns(11d)
+            .returns(12d)
+            .returns(13d)
+            .returns(13d)
+            .returns(13d)
+            .check();
+
+        assertQuery(client, "select salary from account where salary < SOME (12, 12) ORDER BY salary")
+            .returns(10d)
+            .returns(11d)
+            .check();
+
+        assertQuery(client, "select salary from account where salary < ANY (11, 12) ORDER BY salary")
+            .returns(10d)
+            .returns(11d)
+            .check();
+
+        assertQuery(client, "select salary from account where salary > ANY (12, 13) ORDER BY salary")

Review comment:
       `ANY` AFAIK is a synonym for SOME, but what about `ALL` operator? Looks like it also supported now, but there are no tests for `ALL`

##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java
##########
@@ -1216,6 +1216,35 @@ public void testInfixTypeCast() {
         assertThat(qCur.fieldsMeta().get(3).fieldTypeName(), equalTo(String.class.getName()));
     }
 
+    @Test
+    public void quantifiedCompTest() throws InterruptedException {
+        populateTables();
+
+        assertQuery(client, "select salary from account where salary > SOME (10, 11) ORDER BY salary")
+            .returns(11d)
+            .returns(12d)
+            .returns(13d)
+            .returns(13d)
+            .returns(13d)
+            .check();
+
+        assertQuery(client, "select salary from account where salary < SOME (12, 12) ORDER BY salary")
+            .returns(10d)
+            .returns(11d)
+            .check();
+
+        assertQuery(client, "select salary from account where salary < ANY (11, 12) ORDER BY salary")
+            .returns(10d)
+            .returns(11d)
+            .check();
+
+        assertQuery(client, "select salary from account where salary > ANY (12, 13) ORDER BY salary")
+            .returns(13d)
+            .returns(13d)
+            .returns(13d)
+            .check();
+    }

Review comment:
       What about subqueries? Looks like it also works now, but the planning phase took too long. I've checked 
   `select salary from account where salary < ANY (select salary from account where _key >= 3) ORDER BY salary`
   and
   `select salary from account where salary < ALL (select salary from account where _key >= 3) ORDER BY salary`
   queries. First took about 15 seconds for planning, second took about 3 minutes for planning. Should this issues be fixed in scope of this ticket? If not, I think we should at least file a ticket and write a test for subqueries with `@Ignore` annotation.




-- 
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.

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