vldpyatkov commented on code in PR #5370:
URL: https://github.com/apache/calcite/pull/5370#discussion_r4536026832


##########
core/src/main/java/org/apache/calcite/sql/SqlWithItem.java:
##########
@@ -131,10 +146,11 @@ private static class SqlWithItemOperator extends 
SqlSpecialOperator {
     @Override public SqlCall createCall(@Nullable SqlLiteral functionQualifier,
         SqlParserPos pos, @Nullable SqlNode... operands) {
       assert functionQualifier == null;
-      assert operands.length == 4 || operands.length == 5;
+      assert operands.length >= 4 && operands.length <= 6;
       return new SqlWithItem(pos, (SqlIdentifier) operands[0],
           (SqlNodeList) operands[1], operands[2], (SqlLiteral) operands[3],
-          operands.length == 5 ? (SqlCycleClause) operands[4] : null);
+          operands.length >= 5 ? (SqlSearchClause) operands[4] : null,

Review Comment:
   Restricted createCall to 4 or 6 operands.
   Added test: testSqlWithItemCreateCall



##########
core/src/main/java/org/apache/calcite/sql/SqlWithItem.java:
##########
@@ -50,11 +51,19 @@ public SqlWithItem(SqlParserPos pos, SqlIdentifier name,
   public SqlWithItem(SqlParserPos pos, SqlIdentifier name,
       @Nullable SqlNodeList columnList, SqlNode query,
       SqlLiteral recursive, @Nullable SqlCycleClause cycleClause) {
+    this(pos, name, columnList, query, recursive, null, cycleClause);

Review Comment:
   Removed the CYCLE-only constructor.



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