suibianwanwank commented on code in PR #3911:
URL: https://github.com/apache/calcite/pull/3911#discussion_r1712998976


##########
core/src/main/java/org/apache/calcite/sql2rel/StandardConvertletTable.java:
##########
@@ -2135,11 +2137,21 @@ private static class TimestampAddConvertlet implements 
SqlRexConvertlet {
       final RexNode op2;
       switch (call.operandCount()) {
       case 2:
-        // BigQuery-style 'TIMESTAMP_ADD(timestamp, interval)'
-        final SqlBasicCall operandCall = call.operand(1);
-        qualifier  = operandCall.operand(1);
-        op1 = cx.convertExpression(operandCall.operand(0));
-        op2 = cx.convertExpression(call.operand(0));
+        if (call.getOperator() == SqlLibraryOperators.ADD_MONTHS) {
+          qualifier = new SqlIntervalQualifier(TimeUnit.MONTH, null, 
SqlParserPos.ZERO);

Review Comment:
   Add Comment like _BigQuery-style 'TIMESTAMP_ADD(timestamp, interval)_ here , 
would be easier to understand. WDYT



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