This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
new 3a1c5e7ed2 [fix](planner)shouldn't change the child type to
assignmentCompatible Type if it's INVALID_TYPE (#22844)
3a1c5e7ed2 is described below
commit 3a1c5e7ed2fe9d5e0431a1c49bbbef62936239bf
Author: starocean999 <[email protected]>
AuthorDate: Fri Aug 11 17:12:47 2023 +0800
[fix](planner)shouldn't change the child type to assignmentCompatible Type
if it's INVALID_TYPE (#22844)
pick from master #22841
---
.../apache/doris/analysis/FunctionCallExpr.java | 26 ++++++++++++----------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
index 271ba4a41c..0929c24770 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
@@ -1284,20 +1284,22 @@ public class FunctionCallExpr extends Expr {
} else if (fnName.getFunction().equalsIgnoreCase("ifnull") ||
fnName.getFunction().equalsIgnoreCase("nvl")) {
Type[] childTypes = collectChildReturnTypes();
Type assignmentCompatibleType =
ScalarType.getAssignmentCompatibleType(childTypes[0], childTypes[1], true);
- if (assignmentCompatibleType.isDecimalV3()) {
- if (assignmentCompatibleType.isDecimalV3() &&
!childTypes[0].equals(assignmentCompatibleType)) {
- uncheckedCastChild(assignmentCompatibleType, 0);
- }
- if (assignmentCompatibleType.isDecimalV3() &&
!childTypes[1].equals(assignmentCompatibleType)) {
- uncheckedCastChild(assignmentCompatibleType, 1);
+ if (assignmentCompatibleType != Type.INVALID) {
+ if (assignmentCompatibleType.isDecimalV3()) {
+ if (assignmentCompatibleType.isDecimalV3() &&
!childTypes[0].equals(assignmentCompatibleType)) {
+ uncheckedCastChild(assignmentCompatibleType, 0);
+ }
+ if (assignmentCompatibleType.isDecimalV3() &&
!childTypes[1].equals(assignmentCompatibleType)) {
+ uncheckedCastChild(assignmentCompatibleType, 1);
+ }
}
- }
- childTypes[0] = assignmentCompatibleType;
- childTypes[1] = assignmentCompatibleType;
+ childTypes[0] = assignmentCompatibleType;
+ childTypes[1] = assignmentCompatibleType;
- if (childTypes[1].isDecimalV3() && childTypes[0].isDecimalV3()) {
- argTypes[1] = assignmentCompatibleType;
- argTypes[0] = assignmentCompatibleType;
+ if (childTypes[1].isDecimalV3() &&
childTypes[0].isDecimalV3()) {
+ argTypes[1] = assignmentCompatibleType;
+ argTypes[0] = assignmentCompatibleType;
+ }
}
fn = getBuiltinFunction(fnName.getFunction(), childTypes,
Function.CompareMode.IS_NONSTRICT_SUPERTYPE_OF);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]