zstan commented on code in PR #13019:
URL: https://github.com/apache/ignite/pull/13019#discussion_r3077533716
##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/DistributedJoinIntegrationTest.java:
##########
@@ -130,6 +132,26 @@ public void testJoinWithBroadcastAggregate() {
.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'");
+ }
+
+ /** */
+ @Test
+ public void testLeftAsofJoinUnsupported() {
+ 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" +
+ " LEFT_ASOF JOIN (VALUES (1, NULL), (1, 2), (1, 3), (2, 10), (2,
0)) AS t2(k, t)\n" +
Review Comment:
```suggestion
" LEFT ASOF JOIN (VALUES (1, NULL), (1, 2), (1, 3), (2, 10), (2,
0)) AS t2(k, t)\n" +
```
##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/DistributedJoinIntegrationTest.java:
##########
@@ -130,6 +132,26 @@ public void testJoinWithBroadcastAggregate() {
.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'");
+ }
+
+ /** */
+ @Test
+ public void testLeftAsofJoinUnsupported() {
+ 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" +
+ " LEFT_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", ParseException.class, "Encountered
\"LEFT_ASOF\"");
Review Comment:
after upper fix, this will be parsed correctly
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/IgniteSqlValidator.java:
##########
@@ -327,6 +328,14 @@ else if (call.getKind() == SqlKind.CAST) {
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()));
Review Comment:
```suggestion
throw newValidationError(join,
IgniteResource.INSTANCE.unsupportedJoinType(join.getJoinType().toString().replace("_",
" ")));
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]