JackieTien97 commented on code in PR #15308:
URL: https://github.com/apache/iotdb/pull/15308#discussion_r2053183879


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java:
##########
@@ -2186,6 +2218,10 @@ public Node 
visitJoinRelation(RelationalSqlParser.JoinRelationContext ctx) {
       joinType = Join.Type.INNER;
     }
 
+    if (joinType != Join.Type.INNER && hasTolerance) {
+      throw new SemanticException("Tolerance is only supported in ASOF INNER 
JOIN");
+    }

Review Comment:
   why we need this restriction?



##########
iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4:
##########
@@ -919,6 +920,10 @@ aliasedRelation
     : relationPrimary (AS? identifier columnAliases?)?
     ;
 
+toleranceParameter
+    : '(' TOLERANCE (timeDuration | INTEGER_VALUE) ')'

Review Comment:
   ```suggestion
       : '(' TOLERANCE timeDuration ')'
   ```
   no need to support INTEGER_VALUE, in date_bin, we also only support 
timeDuration



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java:
##########
@@ -2186,6 +2214,10 @@ public Node 
visitJoinRelation(RelationalSqlParser.JoinRelationContext ctx) {
       joinType = Join.Type.INNER;
     }
 
+    if (criteria instanceof AsofJoinOn && joinType != Join.Type.INNER) {
+      throw new SemanticException("ASOF JOIN is only support INNER type now");
+    }

Review Comment:
   why we need this restriction? left asof join should also support tolerance



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

Reply via email to