sohardforaname commented on code in PR #18209: URL: https://github.com/apache/doris/pull/18209#discussion_r1189475590
########## fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java: ########## @@ -1337,7 +1337,8 @@ public void analyzeImpl(Analyzer analyzer) throws AnalysisException { Function.CompareMode.IS_NONSTRICT_SUPERTYPE_OF); } else if (fnName.getFunction().equalsIgnoreCase("if")) { Type[] childTypes = collectChildReturnTypes(); - Type assignmentCompatibleType = ScalarType.getAssignmentCompatibleType(childTypes[1], childTypes[2], true); + Type assignmentCompatibleType = Type.convertDateLikeTypeToV2( + ScalarType.getAssignmentCompatibleType(childTypes[1], childTypes[2], true)); Review Comment: because the assignmentCompatibleType may be date and childType is [date, null_type], and the null_type will be replaced to datev2 type, so we add this to ensure the assignmentCompatibleType is datev2 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: 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