[fix](planner) fix wrong resut of function ifnull/coalesce caused by … (#36727)
This commit is contained in:
@ -1591,6 +1591,14 @@ public class FunctionCallExpr extends Expr {
|
||||
argTypes[i] = assignmentCompatibleType;
|
||||
}
|
||||
}
|
||||
} else if (assignmentCompatibleType.isDateV2OrDateTimeV2()) {
|
||||
for (int i = 0; i < childTypes.length; i++) {
|
||||
if (assignmentCompatibleType.isDateV2OrDateTimeV2()
|
||||
&& !childTypes[i].equals(assignmentCompatibleType)) {
|
||||
uncheckedCastChild(assignmentCompatibleType, i);
|
||||
argTypes[i] = assignmentCompatibleType;
|
||||
}
|
||||
}
|
||||
}
|
||||
fn = getBuiltinFunction(fnName.getFunction(), argTypes,
|
||||
Function.CompareMode.IS_NONSTRICT_SUPERTYPE_OF);
|
||||
|
||||
@ -23,6 +23,8 @@ import org.apache.doris.nereids.exceptions.AnalysisException;
|
||||
import org.apache.doris.nereids.trees.expressions.Expression;
|
||||
import org.apache.doris.nereids.trees.expressions.literal.Literal;
|
||||
import org.apache.doris.nereids.types.DataType;
|
||||
import org.apache.doris.nereids.types.DateTimeType;
|
||||
import org.apache.doris.nereids.types.DateTimeV2Type;
|
||||
import org.apache.doris.nereids.types.DateType;
|
||||
import org.apache.doris.nereids.types.DateV2Type;
|
||||
import org.apache.doris.nereids.types.DecimalV3Type;
|
||||
@ -191,6 +193,9 @@ public class SearchSignature {
|
||||
nonStrictMatched++;
|
||||
if (sigArgType instanceof DateV2Type && realType instanceof DateType) {
|
||||
dateToDateV2Count++;
|
||||
} else if (sigArgType instanceof DateTimeV2Type && (realType instanceof DateTimeType
|
||||
|| realType instanceof DateV2Type || realType instanceof DateType)) {
|
||||
dateToDateV2Count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user