github-actions[bot] commented on code in PR #68732:
URL: https://github.com/apache/doris/pull/68732#discussion_r4226497756
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/DateTimeExtractAndTransform.java:
##########
@@ -408,7 +408,11 @@ public static Expression timeFormat(TimeV2Literal time,
StringLikeLiteral format
throw new AnalysisException("The length of format string in
time_format() function should not be greater"
+ " than 128.");
}
- return new
VarcharLiteral(DateTimeFormatterUtils.toFormatStringConservative(time, format));
+ String formatted =
DateTimeFormatterUtils.toFormatStringConservative(time, format);
+ if (formatted == null) {
+ return new NullLiteral(StringType.INSTANCE);
Review Comment:
[P2] Keep the folded NULL's declared VARCHAR type. `time_format` returns
VARCHAR, but this branch builds `NullLiteral(StringType.INSTANCE)`. In a
table-backed `SELECT time_format(CAST('-10:00:00' AS TIME), '%a') AS fmt FROM
t`, the folded project registers a STRING slot; result translation resolves it
by ExprId and `StmtExecutor` advertises that field as MySQL BLOB rather than
VARCHAR. Return a VARCHAR-typed NULL and add a planner-level check of the
result field type.
--
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]