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

nizhikov pushed a commit to branch IGNITE-28536
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 56ce0fcccffa5456965177b2ab344496f7c2b64a
Author: Nikolay Izhikov <[email protected]>
AuthorDate: Mon Apr 13 23:28:36 2026 +0300

    IGNITE-28536 Explicit error message on ASOF join
---
 .../processors/query/calcite/prepare/IgniteSqlValidator.java  |  9 +++++++++
 .../processors/query/calcite/util/IgniteResource.java         |  4 ++++
 .../calcite/integration/DistributedJoinIntegrationTest.java   | 11 +++++++++++
 3 files changed, 24 insertions(+)

diff --git 
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/IgniteSqlValidator.java
 
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/IgniteSqlValidator.java
index 92308f805a4..605d59daf49 100644
--- 
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/IgniteSqlValidator.java
+++ 
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/IgniteSqlValidator.java
@@ -30,6 +30,7 @@ import org.apache.calcite.prepare.Prepare;
 import org.apache.calcite.rel.type.RelDataType;
 import org.apache.calcite.rel.type.RelDataTypeField;
 import org.apache.calcite.sql.JoinConditionType;
+import org.apache.calcite.sql.JoinType;
 import org.apache.calcite.sql.SqlAggFunction;
 import org.apache.calcite.sql.SqlCall;
 import org.apache.calcite.sql.SqlCallBinding;
@@ -327,6 +328,14 @@ public class IgniteSqlValidator extends SqlValidatorImpl {
         super.validateAggregateParams(aggCall, filter, null, orderList, scope);
     }
 
+    /** {@inheritDoc} */
+    @Override protected void validateJoin(SqlJoin join, SqlValidatorScope 
scope) {
+        if (join.getJoinType() == JoinType.ASOF || join.getJoinType() == 
JoinType.LEFT_ASOF)
+            throw newValidationError(join, 
IgniteResource.INSTANCE.unsupportedJoinType(join.getJoinType().name()));
+
+        super.validateJoin(join, scope);
+    }
+
     /** {@inheritDoc} */
     @Override protected SqlNode performUnconditionalRewrites(SqlNode node, 
boolean underFrom) {
         // Workaround for https://issues.apache.org/jira/browse/CALCITE-4923
diff --git 
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/IgniteResource.java
 
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/IgniteResource.java
index f4d7181c6fd..df74d56a916 100644
--- 
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/IgniteResource.java
+++ 
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/IgniteResource.java
@@ -77,6 +77,10 @@ public interface IgniteResource {
     @Resources.BaseMessage("Unsupported clause ''{0}''")
     Resources.ExInst<SqlValidatorException> unsupportedClause(String value);
 
+    /** */
+    @Resources.BaseMessage("Unsupported join type ''{0}''")
+    Resources.ExInst<SqlValidatorException> unsupportedJoinType(String value);
+
     /** */
     @Resources.BaseMessage("Operator ''CAST'' supports only the parameters: 
value and target type.")
     Resources.ExInst<SqlValidatorException> invalidCastParameters();
diff --git 
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/DistributedJoinIntegrationTest.java
 
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/DistributedJoinIntegrationTest.java
index e4feefe83a3..b49e0247774 100644
--- 
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/DistributedJoinIntegrationTest.java
+++ 
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/DistributedJoinIntegrationTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.query.calcite.integration;
 
 import java.math.BigDecimal;
+import org.apache.ignite.internal.processors.query.IgniteSQLException;
 import org.apache.ignite.internal.processors.query.calcite.QueryChecker;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.junit.Test;
@@ -130,6 +131,16 @@ public class DistributedJoinIntegrationTest extends 
AbstractBasicIntegrationTran
             .check();
     }
 
+    /** */
+    @Test
+    public void testAsofJoinUnsupported() {
+        assertThrows("SELECT *\n" +
+            " FROM (VALUES (NULL, 0), (1, NULL), (1, 0), (1, 1), (1, 2), (1, 
3), (1, 4), (2, 3), (3, 4)) AS t1(k, t)\n" +
+            " ASOF JOIN (VALUES (1, NULL), (1, 2), (1, 3), (2, 10), (2, 0)) AS 
t2(k, t)\n" +
+            " MATCH_CONDITION t2.t < t1.t\n" +
+            " ON t1.k = t2.k", IgniteSQLException.class, "Unsupported join 
type 'ASOF'");
+    }
+
     /** Prepare tables orders and order_items with data. */
     private void prepareTables() {
         sql("CREATE TABLE items (\n" +

Reply via email to