xiedeyantu commented on code in PR #4514:
URL: https://github.com/apache/calcite/pull/4514#discussion_r2315026127


##########
core/src/main/java/org/apache/calcite/sql/fun/SqlTimestampAddFunction.java:
##########
@@ -129,8 +130,15 @@ static RelDataType deduceType(RelDataTypeFactory 
typeFactory,
     //    with startUnit = EPOCH and timeFrameName = 'MINUTE15'.
     //
     // If the latter, check that timeFrameName is valid.
-    validator.validateTimeFrame(
-        (SqlIntervalQualifier) call.getOperandList().get(0));
+    SqlIntervalQualifier op0 = call.operand(0);
+    validator.validateTimeFrame(op0);
+    if (op0.timeFrameName == null

Review Comment:
   Is it possible to provide a method in `SqlValidatorImpl`  to do this check? 
But it looks good at the moment, maybe I'm too picky.



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