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

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


The following commit(s) were added to refs/heads/master by this push:
     new 82995b429ea IGNITE-23004 SQL Calcite: Add test for complex key index 
scan (binary objects comparison) - Fixes #11598.
82995b429ea is described below

commit 82995b429ea5e900593227feaa89e1653c8783bb
Author: Aleksey Plekhanov <[email protected]>
AuthorDate: Fri Oct 18 10:34:13 2024 +0300

    IGNITE-23004 SQL Calcite: Add test for complex key index scan (binary 
objects comparison) - Fixes #11598.
    
    Signed-off-by: Aleksey Plekhanov <[email protected]>
---
 .../IndexScanMultiNodeIntegrationTest.java         | 64 ++++++++++++++++++++++
 .../ignite/testsuites/IntegrationTestSuite.java    |  2 +
 2 files changed, 66 insertions(+)

diff --git 
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/IndexScanMultiNodeIntegrationTest.java
 
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/IndexScanMultiNodeIntegrationTest.java
new file mode 100644
index 00000000000..f890fd2d01c
--- /dev/null
+++ 
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/IndexScanMultiNodeIntegrationTest.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.query.calcite.integration;
+
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.QueryEntity;
+import org.apache.ignite.cache.query.annotations.QuerySqlField;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.internal.util.typedef.F;
+import org.junit.Test;
+
+/**
+ * Multi node index scan test.
+ */
+public class IndexScanMultiNodeIntegrationTest extends 
AbstractBasicIntegrationTransactionalTest {
+    /** */
+    @Test
+    public void testComplexKeyScan() {
+        IgniteCache<EmployerKey, Employer> emp = client.getOrCreateCache(
+            new CacheConfiguration<EmployerKey, Employer>("emp")
+                .setSqlSchema("PUBLIC")
+                .setQueryEntities(F.asList(new QueryEntity(EmployerKey.class, 
Employer.class).setTableName("emp")))
+                .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
+        );
+
+        for (int i = 0; i < 100; i++)
+            put(client, emp, new EmployerKey(i, i), new Employer("emp" + i, 
(double)i));
+
+        assertQuery("SELECT /*+ FORCE_INDEX(\"_key_PK\") */ _key FROM 
emp").resultSize(100).check();
+    }
+
+    /** */
+    private static class EmployerKey {
+        /** */
+        @QuerySqlField
+        private final int id0;
+
+        /** */
+        @QuerySqlField
+        private final int id1;
+
+        /** */
+        private EmployerKey(int id0, int id1) {
+            this.id0 = id0;
+            this.id1 = id1;
+        }
+    }
+}
diff --git 
a/modules/calcite/src/test/java/org/apache/ignite/testsuites/IntegrationTestSuite.java
 
b/modules/calcite/src/test/java/org/apache/ignite/testsuites/IntegrationTestSuite.java
index c3f89473daf..dc27a636e77 100644
--- 
a/modules/calcite/src/test/java/org/apache/ignite/testsuites/IntegrationTestSuite.java
+++ 
b/modules/calcite/src/test/java/org/apache/ignite/testsuites/IntegrationTestSuite.java
@@ -37,6 +37,7 @@ import 
org.apache.ignite.internal.processors.query.calcite.integration.HashSpool
 import 
org.apache.ignite.internal.processors.query.calcite.integration.IndexDdlIntegrationTest;
 import 
org.apache.ignite.internal.processors.query.calcite.integration.IndexMultiRangeScanIntegrationTest;
 import 
org.apache.ignite.internal.processors.query.calcite.integration.IndexRebuildIntegrationTest;
+import 
org.apache.ignite.internal.processors.query.calcite.integration.IndexScanMultiNodeIntegrationTest;
 import 
org.apache.ignite.internal.processors.query.calcite.integration.IndexScanlIntegrationTest;
 import 
org.apache.ignite.internal.processors.query.calcite.integration.IndexSpoolIntegrationTest;
 import 
org.apache.ignite.internal.processors.query.calcite.integration.IntervalTest;
@@ -112,6 +113,7 @@ import org.junit.runners.Suite;
     IndexSpoolIntegrationTest.class,
     HashSpoolIntegrationTest.class,
     IndexScanlIntegrationTest.class,
+    IndexScanMultiNodeIntegrationTest.class,
     SetOpIntegrationTest.class,
     UnstableTopologyTest.class,
     JoinCommuteRulesTest.class,

Reply via email to