xy2953396112 commented on a change in pull request #2014:
URL: https://github.com/apache/calcite/pull/2014#discussion_r454962707



##########
File path: core/src/main/java/org/apache/calcite/sql/SqlUtil.java
##########
@@ -261,6 +261,32 @@ public static boolean isLiteralChain(SqlNode node) {
     }
   }
 
+  /**
+   * Unparses a call to an operator which has special syntax.
+   *
+   * @param operator The operator
+   * @param writer   Writer
+   * @param call     List of 0 or more operands
+   */
+  public static void unparseSpecialSyntax(SqlOperator operator,

Review comment:
       `SqlUtil#unparseSpecialSyntax` is used for unparse `SqlSyntax.SPECIAL`. 
other processing logic also exists in SqlUtil.
   
   

##########
File path: core/src/main/java/org/apache/calcite/sql/SqlUtil.java
##########
@@ -261,6 +261,32 @@ public static boolean isLiteralChain(SqlNode node) {
     }
   }
 
+  /**
+   * Unparses a call to an operator which has special syntax.
+   *
+   * @param operator The operator
+   * @param writer   Writer
+   * @param call     List of 0 or more operands
+   */
+  public static void unparseSpecialSyntax(SqlOperator operator,
+      SqlWriter writer,
+      SqlCall call) {
+    final List<SqlNode> operands = call.getOperandList();
+    switch (operator.getKind()) {
+    case INSERT:
+      assert operands.size() == 3 || operands.size() == 4;
+      final SqlInsert insert = new SqlInsert(call.getParserPosition(),
+          (SqlNodeList) operands.get(0), operands.get(1), operands.get(2),
+          operands.size() == 3 ? null : (SqlNodeList) 
call.getOperandList().get(3));

Review comment:
       @yanlin-Lynn @zinking 
   Thanks.The size of operands is always 4, update the code.




----------------------------------------------------------------
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:
[email protected]


Reply via email to