morrySnow commented on code in PR #20863:
URL: https://github.com/apache/doris/pull/20863#discussion_r1233187919
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ComputeSignatureHelper.java:
##########
@@ -123,7 +124,13 @@ private static FunctionSignature
defaultDateTimeV2PrecisionPromotion(
continue;
}
if (finalType == null) {
- finalType =
DateTimeV2Type.forType(arguments.get(i).getDataType());
+ if (arguments.get(i) instanceof VarcharLiteral) {
Review Comment:
maybe u need use StringLikeLiteral
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/types/DateTimeV2Type.java:
##########
@@ -78,6 +78,17 @@ public static DateTimeV2Type forType(DataType dataType) {
return MAX;
}
+ /**
+ * return proper type of datetimev2 for VarcharLiteral
+ * may be we need to check for validity?
+ */
+ public static DateTimeV2Type forTypeFromVarcharLiteral(String s) {
Review Comment:
```suggestion
public static DateTimeV2Type forExpression(Expression e) {
if (e instanceof StringLikeLiteral) {
....
} else {
return forType(e.getDataType());
}
```
--
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]