morrySnow commented on code in PR #49119: URL: https://github.com/apache/doris/pull/49119#discussion_r2020467791
########## fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/DateTimeExtractAndTransform.java: ########## @@ -1167,4 +1196,26 @@ public static Expression yearsDiff(DateV2Literal t1, DateV2Literal t2) { public static Expression yearsDiff(DateTimeLiteral t1, DateTimeLiteral t2) { return new BigIntLiteral(ChronoUnit.YEARS.between(t2.toJavaDateType(), t1.toJavaDateType())); } + + private static int getDayOfWeek(String day) { + Integer dayOfWeek = DAY_OF_WEEK.get(day.toUpperCase()); + if (dayOfWeek == null) { + return 0; + } + return dayOfWeek; + } + + /** + * date arithmetic function next_day + */ + @ExecFunction(name = "next_day") + public static Expression nextDay(DateV2Literal date, StringLiteral day) { Review Comment: add date related constant folding test should be added in `regression-test/suites/nereids_p0/expression/fold_constant/fold_constant_date_arithmatic.groovy` -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org