You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by al...@apache.org on 2021/09/02 13:41:14 UTC

[ignite] branch sql-calcite updated: IGNITE-14593 Support bang-equal operator - Fixes #9364.

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

alexpl pushed a commit to branch sql-calcite
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/sql-calcite by this push:
     new 65c9d57  IGNITE-14593 Support bang-equal operator - Fixes #9364.
65c9d57 is described below

commit 65c9d5714923e8a5a5e644756c03f1d9d68868e4
Author: Vladimir Steshin <vl...@gmail.com>
AuthorDate: Thu Sep 2 16:39:37 2021 +0300

    IGNITE-14593 Support bang-equal operator - Fixes #9364.
    
    Signed-off-by: Aleksey Plekhanov <pl...@gmail.com>
---
 .../query/calcite/sql/IgniteSqlConformance.java    |  5 +++++
 .../query/calcite/CalciteQueryProcessorTest.java   | 23 +++++++++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/IgniteSqlConformance.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/IgniteSqlConformance.java
index 52750fe..c30e672 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/IgniteSqlConformance.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/IgniteSqlConformance.java
@@ -30,4 +30,9 @@ public class IgniteSqlConformance extends SqlAbstractConformance {
     @Override public boolean isPercentRemainderAllowed() {
         return true;
     }
+
+    /** {@inheritDoc} */
+    @Override public boolean isBangEqualAllowed() {
+        return true;
+    }
 }
diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java
index c4fdbb0..d935a40 100644
--- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java
+++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java
@@ -255,6 +255,27 @@ public class CalciteQueryProcessorTest extends GridCommonAbstractTest {
     }
 
     /**
+     * Checks bang equal is allowed and works.
+     */
+    @Test
+    public void testBangEqual() throws Exception {
+        IgniteCache<Integer, Developer> developer = grid(1).createCache(new CacheConfiguration<Integer, Developer>()
+            .setName("developer")
+            .setSqlSchema("PUBLIC")
+            .setIndexedTypes(Integer.class, Developer.class)
+            .setBackups(2)
+        );
+
+        developer.put(1, new Developer("Name1", 1));
+        developer.put(10, new Developer("Name10", 10));
+        developer.put(100, new Developer("Name100", 100));
+
+        awaitPartitionMapExchange(true, true, null);
+
+        assertEquals(2, sql("SELECT * FROM Developer WHERE projectId != ?", false, 1).size());
+    }
+
+    /**
      * Checks all grids execution contexts are closed or registered (Out|In)boxes are present.
      */
     private void checkContextCancelled() throws IgniteInterruptedCheckedException {
@@ -1201,7 +1222,7 @@ public class CalciteQueryProcessorTest extends GridCommonAbstractTest {
         List<List<?>> allSrv;
 
         if (!noCheck) {
-            List<FieldsQueryCursor<List<?>>> cursorsSrv = engineSrv.query(null, "PUBLIC", sql);
+            List<FieldsQueryCursor<List<?>>> cursorsSrv = engineSrv.query(null, "PUBLIC", sql, args);
 
             try (QueryCursor srvCursor = cursorsSrv.get(0); QueryCursor cliCursor = cursorsCli.get(0)) {
                 allSrv = srvCursor.getAll();