amaliujia commented on a change in pull request #1647: [CALCITE-3588] Support 
more operators in Join condition when convert …
URL: https://github.com/apache/calcite/pull/1647#discussion_r357291897
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java
 ##########
 @@ -193,102 +193,12 @@ public Result setOpToSql(SqlSetOperator operator, 
RelNode rel) {
    * @param node            Join condition
    * @param leftContext     Left context
    * @param rightContext    Right context
-   * @param leftFieldCount  Number of fields on left result
    * @return SqlNode that represents the condition
    */
-  public static SqlNode convertConditionToSqlNode(RexNode node,
-      Context leftContext,
-      Context rightContext,
-      int leftFieldCount,
-      SqlDialect dialect) {
-    if (node.isAlwaysTrue()) {
-      return SqlLiteral.createBoolean(true, POS);
-    }
-    if (node.isAlwaysFalse()) {
-      return SqlLiteral.createBoolean(false, POS);
-    }
-    if (node instanceof RexInputRef) {
-      Context joinContext = leftContext.implementor().joinContext(leftContext, 
rightContext);
-      return joinContext.toSql(null, node);
-    }
-    if (!(node instanceof RexCall)) {
-      throw new AssertionError(node);
 
 Review comment:
   I tried a INNER JOIN query with `ON 1` and Calcite validator throws an 
exception "ON clause must be a condition".
   
   Regrading to the specific assertion we have discussed, it might just minor 
so either keep it or remove it is fine.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to