zinking commented on a change in pull request #2014:
URL: https://github.com/apache/calcite/pull/2014#discussion_r453618841
##########
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:
I mean:
1. why `null`, is there a better value to pass
2. call.getOperandList() => operands
----------------------------------------------------------------
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]