englefly commented on code in PR #18275:
URL: https://github.com/apache/doris/pull/18275#discussion_r1155118195
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ExecutableFunctions.java:
##########
@@ -592,13 +592,18 @@ public static Literal divideDecimalV3(DecimalV3Literal
first, DecimalV3Literal s
t1.getPrecision(), t1.getScale() - t2.getScale()), result);
}
+ @ExecFunction(name = "date_sub", argTypes = { "DATE", "INT" }, returnType
= "DATE")
+ public static DateLiteral dateSub(DateLiteral date, IntegerLiteral day)
throws AnalysisException {
+ return dateAdd(date, new IntegerLiteral(-day.getValue()));
+ }
+
@ExecFunction(name = "date_sub", argTypes = { "DATETIME", "INT" },
returnType = "DATETIME")
public static DateTimeLiteral dateSub(DateTimeLiteral date, IntegerLiteral
day) throws AnalysisException {
return dateAdd(date, new IntegerLiteral(-day.getValue()));
}
- @ExecFunction(name = "date_sub", argTypes = { "DATE", "INT" }, returnType
= "DATE")
- public static DateLiteral dateSub(DateLiteral date, IntegerLiteral day)
throws AnalysisException {
+ @ExecFunction(name = "date_sub", argTypes = { "DATEV2", "INT" },
returnType = "DATEV2")
Review Comment:
it is better to line595-599 to line 604 in order to save review effort.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]