This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 72e1080eb21 [opt](coercion) String type has the highest precedence in 
contexts other than comparison expressions. (#56172)
72e1080eb21 is described below

commit 72e1080eb21d92d288ef145232bfa4a38d3cd1b3
Author: morrySnow <[email protected]>
AuthorDate: Fri Sep 19 09:49:41 2025 +0800

    [opt](coercion) String type has the highest precedence in contexts other 
than comparison expressions. (#56172)
    
    ### What problem does this PR solve?
    
    Related PR: #55672
    
    Problem Summary:
    
    Since Doris cannot report an error when implicit type conversion between
    types such as int and text occurs, string type is set to have the
    highest precedence in all scenarios except comparison expressions, in
    order to avoid precision loss and data distortion.
---
 .../functions/ComputeSignatureHelper.java          |   2 +-
 .../trees/expressions/functions/scalar/Array.java  |   2 +-
 .../expressions/functions/scalar/Coalesce.java     |   4 +-
 .../functions/scalar/GreatestLeast.java            |   4 +-
 .../trees/expressions/functions/scalar/If.java     |   2 +-
 .../trees/expressions/functions/scalar/NullIf.java |   2 +-
 .../trees/expressions/functions/scalar/Nvl.java    |   2 +-
 .../trees/plans/logical/LogicalSetOperation.java   |   2 +-
 .../doris/nereids/util/TypeCoercionUtils.java      |  53 +++++++++++++--------
 .../doris/nereids/util/TypeCoercionMatrixTest.java |   2 +-
 .../test_outer_join_with_window_function.out       | Bin 220 -> 223 bytes
 ...test_outer_join_with_window_function_datev2.out | Bin 220 -> 223 bytes
 .../float/test_float_special_values.out            | Bin 66662 -> 66663 bytes
 .../data/doc/sql-manual/ArrayNullsafe.out          | Bin 8344 -> 8377 bytes
 .../basic-elements/data-types/array-md.out         | Bin 1984 -> 1969 bytes
 .../data/nereids_function_p0/type_coercion.out     | Bin 777 -> 727 bytes
 .../conditional_functions/test_coalesce.out        | Bin 8703 -> 8613 bytes
 .../test_conditional_function.out                  | Bin 2722 -> 2682 bytes
 .../conditional_functions/test_nullif.out          | Bin 4701 -> 4248 bytes
 .../data/nereids_p0/union/test_union.out           | Bin 13952 -> 13923 bytes
 .../infer_predicate/infer_intersect_except.out     | Bin 4335 -> 4328 bytes
 .../infer_predicate/pull_up_predicate_set_op.out   | Bin 19873 -> 19725 bytes
 .../simplify_conditional_function.out              | Bin 1281 -> 1223 bytes
 .../data/nereids_syntax_p0/set_operation.out       | Bin 5494 -> 3619 bytes
 .../sql/test_compare_expression.out                | Bin 781 -> 784 bytes
 .../query_p0/cast/test_complextype_to_json.out     | Bin 1498 -> 1464 bytes
 .../sql_functions/array_functions/sql/q02.out      | Bin 2854 -> 2826 bytes
 .../array_functions/test_array_functions.out       | Bin 29216 -> 29072 bytes
 .../test_array_functions_by_literal.out            | Bin 30420 -> 30210 bytes
 .../test_array_functions_with_where.out            | Bin 1911 -> 1863 bytes
 .../conditional_functions/test_coalesce.out        | Bin 8703 -> 8613 bytes
 .../test_conditional_function.out                  | Bin 3303 -> 3283 bytes
 .../conditional_functions/test_nullif.out          | Bin 4574 -> 4276 bytes
 regression-test/data/query_p0/union/test_union.out | Bin 13952 -> 13923 bytes
 .../suites/nereids_p0/datatype/test_cast.groovy    |   2 +-
 .../datatype/test_date_implicit_cast.groovy        |   6 +--
 .../fold_constant/fold_constant_by_be.groovy       |   2 +-
 .../suites/query_p0/cast/test_cast.groovy          |   4 +-
 38 files changed, 52 insertions(+), 37 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ComputeSignatureHelper.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ComputeSignatureHelper.java
index 5b55681e552..c7bde4b8b9c 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ComputeSignatureHelper.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ComputeSignatureHelper.java
@@ -304,7 +304,7 @@ public class ComputeSignatureHelper {
         for (Map.Entry<Integer, List<DataType>> dataTypes : 
indexToArgumentTypes.entrySet()) {
             Optional<DataType> dataType;
             if (GlobalVariable.enableNewTypeCoercionBehavior) {
-                dataType = 
TypeCoercionUtils.findWiderCommonType(dataTypes.getValue(), false);
+                dataType = 
TypeCoercionUtils.findWiderCommonType(dataTypes.getValue(), false, true);
             } else {
                 dataType = 
TypeCoercionUtils.findWiderCommonTypeForComparison(dataTypes.getValue());
             }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Array.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Array.java
index de23af81b59..11257ef87de 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Array.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Array.java
@@ -94,7 +94,7 @@ public class Array extends ScalarFunction
             return SIGNATURES;
         }
         Optional<DataType> commonDataType = 
TypeCoercionUtils.findWiderCommonTypeByVariable(
-                
children.stream().map(ExpressionTrait::getDataType).collect(Collectors.toList()),
 true);
+                
children.stream().map(ExpressionTrait::getDataType).collect(Collectors.toList()),
 true, true);
         if (commonDataType.isPresent()) {
             return ImmutableList.of(
                     
FunctionSignature.ret(ArrayType.of(commonDataType.get())).varArgs(commonDataType.get()));
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Coalesce.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Coalesce.java
index d3ff47324b3..8165c7d1cf4 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Coalesce.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Coalesce.java
@@ -82,7 +82,7 @@ public class Coalesce extends ScalarFunction implements 
CustomSignature {
         List<DataType> forFindCommon = partitioned.get(false).stream()
                 .map(ExpressionTrait::getDataType)
                 .collect(Collectors.toList());
-        Optional<DataType> commonType = 
TypeCoercionUtils.findWiderCommonTypeByVariable(forFindCommon, false);
+        Optional<DataType> commonType = 
TypeCoercionUtils.findWiderCommonTypeByVariable(forFindCommon, false, true);
         if (!commonType.isPresent()) {
             SearchSignature.throwCanNotFoundFunctionException(this.getName(), 
getArguments());
             return null;
@@ -92,7 +92,7 @@ public class Coalesce extends ScalarFunction implements 
CustomSignature {
                         ((Literal) stringLiteral).getStringValue(), 
commonType.get());
                 if (!option.isPresent()) {
                     commonType = TypeCoercionUtils.findWiderTypeForTwo(
-                            commonType.get(), stringLiteral.getDataType(), 
false);
+                            commonType.get(), stringLiteral.getDataType(), 
false, true);
                     if (!commonType.isPresent()) {
                         
SearchSignature.throwCanNotFoundFunctionException(this.getName(), 
getArguments());
                     } else {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/GreatestLeast.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/GreatestLeast.java
index d894dcbdd88..5cd6d59b70e 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/GreatestLeast.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/GreatestLeast.java
@@ -59,7 +59,7 @@ public abstract class GreatestLeast extends ScalarFunction
         List<DataType> forFindCommon = partitioned.get(false).stream()
                 .map(ExpressionTrait::getDataType)
                 .collect(Collectors.toList());
-        Optional<DataType> commonType = 
TypeCoercionUtils.findWiderCommonTypeByVariable(forFindCommon, false);
+        Optional<DataType> commonType = 
TypeCoercionUtils.findWiderCommonTypeByVariable(forFindCommon, false, false);
         if (!commonType.isPresent()) {
             SearchSignature.throwCanNotFoundFunctionException(this.getName(), 
getArguments());
             return null;
@@ -69,7 +69,7 @@ public abstract class GreatestLeast extends ScalarFunction
                         ((Literal) stringLiteral).getStringValue(), 
commonType.get());
                 if (!option.isPresent()) {
                     commonType = TypeCoercionUtils.findWiderTypeForTwo(
-                            commonType.get(), stringLiteral.getDataType(), 
false);
+                            commonType.get(), stringLiteral.getDataType(), 
false, false);
                     if (!commonType.isPresent()) {
                         
SearchSignature.throwCanNotFoundFunctionException(this.getName(), 
getArguments());
                     } else {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/If.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/If.java
index 2ab923963f7..cf65aa68a06 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/If.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/If.java
@@ -84,7 +84,7 @@ public class If extends ScalarFunction
         Optional<DataType> commonType;
         try {
             commonType = TypeCoercionUtils.findWiderTypeForTwoByVariable(
-                    getArgumentType(1), getArgumentType(2), false);
+                    getArgumentType(1), getArgumentType(2), false, true);
         } catch (Exception e) {
             SearchSignature.throwCanNotFoundFunctionException(this.getName(), 
getArguments());
             return null;
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/NullIf.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/NullIf.java
index 29f0a98b572..7d2acc31215 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/NullIf.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/NullIf.java
@@ -64,7 +64,7 @@ public class NullIf extends ScalarFunction
         Optional<DataType> commonType;
         try {
             commonType = TypeCoercionUtils.findWiderTypeForTwoByVariable(
-                    getArgumentType(0), getArgumentType(1), false);
+                    getArgumentType(0), getArgumentType(1), false, true);
         } catch (Exception e) {
             SearchSignature.throwCanNotFoundFunctionException(this.getName(), 
getArguments());
             return null;
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Nvl.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Nvl.java
index b9b415c29d9..140af1bad8a 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Nvl.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Nvl.java
@@ -71,7 +71,7 @@ public class Nvl extends ScalarFunction
         Optional<DataType> commonType;
         try {
             commonType = TypeCoercionUtils.findWiderTypeForTwoByVariable(
-                    getArgumentType(0), getArgumentType(1), false);
+                    getArgumentType(0), getArgumentType(1), false, true);
         } catch (Exception e) {
             SearchSignature.throwCanNotFoundFunctionException(this.getName(), 
getArguments());
             return null;
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalSetOperation.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalSetOperation.java
index 52368849bdd..d30b808e2eb 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalSetOperation.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalSetOperation.java
@@ -235,7 +235,7 @@ public abstract class LogicalSetOperation extends 
AbstractLogicalPlan
     /** getAssignmentCompatibleType */
     public static DataType getAssignmentCompatibleType(DataType left, DataType 
right) {
         if (GlobalVariable.enableNewTypeCoercionBehavior) {
-            Optional<DataType> commonType = 
TypeCoercionUtils.findWiderTypeForTwo(left, right, false);
+            Optional<DataType> commonType = 
TypeCoercionUtils.findWiderTypeForTwo(left, right, false, true);
             if (commonType.isPresent()) {
                 return commonType.get();
             }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java
index da7a6e92eb7..0c5771b24b6 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java
@@ -1113,7 +1113,8 @@ public class TypeCoercionUtils {
      * find wider type for input
      * @return if find return wider type, if not find return Optional.empty()
      */
-    public static Optional<DataType> findWiderTypeForTwo(DataType left, 
DataType right, boolean overflowToDouble) {
+    public static Optional<DataType> findWiderTypeForTwo(DataType left, 
DataType right,
+            boolean overflowToDouble, boolean stringIsHighPriority) {
         if (left.equals(right)) {
             return Optional.of(left);
         } else if (left instanceof NullType) {
@@ -1135,14 +1136,14 @@ public class TypeCoercionUtils {
                             DecimalV2Type.class, 
DecimalV3Type.SYSTEM_DEFAULT), DecimalV3Type.SYSTEM_DEFAULT),
                     FloatType.class, DoubleType.INSTANCE));
         } else if (left instanceof ComplexDataType || right instanceof 
ComplexDataType) {
-            return findWiderComplexTypeForTwo(left, right, overflowToDouble);
+            return findWiderComplexTypeForTwo(left, right, overflowToDouble, 
stringIsHighPriority);
         } else {
-            return findWiderPrimitiveTypeForTwo(left, right, overflowToDouble);
+            return findWiderPrimitiveTypeForTwo(left, right, overflowToDouble, 
stringIsHighPriority);
         }
     }
 
     private static Optional<DataType> findWiderComplexTypeForTwo(
-            DataType left, DataType right, boolean overflowToDouble) {
+            DataType left, DataType right, boolean overflowToDouble, boolean 
stringIsHighPriority) {
         if (right.isStringLikeType()) {
             return Optional.of(left);
         } else if (left.isStringLikeType()) {
@@ -1153,13 +1154,16 @@ public class TypeCoercionUtils {
             return Optional.of(right);
         } else if (left instanceof ArrayType && right instanceof ArrayType) {
             Optional<DataType> itemType = findWiderTypeForTwo(
-                    ((ArrayType) left).getItemType(), ((ArrayType) 
right).getItemType(), overflowToDouble);
+                    ((ArrayType) left).getItemType(), ((ArrayType) 
right).getItemType(),
+                    overflowToDouble, stringIsHighPriority);
             return itemType.map(ArrayType::of);
         } else if (left instanceof MapType && right instanceof MapType) {
             Optional<DataType> keyType = findWiderTypeForTwo(
-                    ((MapType) left).getKeyType(), ((MapType) 
right).getKeyType(), overflowToDouble);
+                    ((MapType) left).getKeyType(), ((MapType) 
right).getKeyType(),
+                    overflowToDouble, stringIsHighPriority);
             Optional<DataType> valueType = findWiderTypeForTwo(
-                    ((MapType) left).getValueType(), ((MapType) 
right).getValueType(), overflowToDouble);
+                    ((MapType) left).getValueType(), ((MapType) 
right).getValueType(),
+                    overflowToDouble, stringIsHighPriority);
             if (keyType.isPresent() && valueType.isPresent()) {
                 return Optional.of(MapType.of(keyType.get(), valueType.get()));
             }
@@ -1172,7 +1176,8 @@ public class TypeCoercionUtils {
             List<StructField> newFields = Lists.newArrayList();
             for (int i = 0; i < leftFields.size(); i++) {
                 Optional<DataType> newDataType = findWiderTypeForTwo(
-                        leftFields.get(i).getDataType(), 
rightFields.get(i).getDataType(), overflowToDouble);
+                        leftFields.get(i).getDataType(), 
rightFields.get(i).getDataType(),
+                        overflowToDouble, stringIsHighPriority);
                 if (newDataType.isPresent()) {
                     
newFields.add(leftFields.get(i).withDataType(newDataType.get()));
                 } else {
@@ -1185,7 +1190,15 @@ public class TypeCoercionUtils {
     }
 
     private static Optional<DataType> findWiderPrimitiveTypeForTwo(
-            DataType leftType, DataType rightType, boolean overflowToDouble) {
+            DataType leftType, DataType rightType, boolean overflowToDouble, 
boolean stringIsHighPriority) {
+        if (stringIsHighPriority) {
+            if (leftType.isStringLikeType() && canCastTo(rightType, 
StringType.INSTANCE)) {
+                return Optional.of(StringType.INSTANCE);
+            } else if (rightType.isStringLikeType() && canCastTo(leftType, 
StringType.INSTANCE)) {
+                return Optional.of(StringType.INSTANCE);
+            }
+        }
+
         // we process date like type first
         if (!leftType.isDateLikeType() && rightType.isDateLikeType()) {
             DataType temp = leftType;
@@ -1291,7 +1304,7 @@ public class TypeCoercionUtils {
 
         Optional<DataType> commonType;
         if (GlobalVariable.enableNewTypeCoercionBehavior) {
-            commonType = findWiderTypeForTwo(left.getDataType(), 
right.getDataType(), false);
+            commonType = findWiderTypeForTwo(left.getDataType(), 
right.getDataType(), false, false);
         } else {
             commonType = findWiderTypeForTwoForComparison(left.getDataType(), 
right.getDataType(), false);
         }
@@ -1366,7 +1379,7 @@ public class TypeCoercionUtils {
                 .map(Expression::getDataType).collect(Collectors.toList());
         Optional<DataType> optionalCommonType;
         if (GlobalVariable.enableNewTypeCoercionBehavior) {
-            optionalCommonType = 
TypeCoercionUtils.findWiderCommonType(waitForCoercion, false);
+            optionalCommonType = 
TypeCoercionUtils.findWiderCommonType(waitForCoercion, false, false);
         } else {
             optionalCommonType = 
TypeCoercionUtils.findWiderCommonTypeForComparison(waitForCoercion, true);
         }
@@ -1489,7 +1502,7 @@ public class TypeCoercionUtils {
 
         Optional<DataType> optionalCommonType;
         if (GlobalVariable.enableNewTypeCoercionBehavior) {
-            optionalCommonType = 
TypeCoercionUtils.findWiderCommonType(dataTypesForCoercion, false);
+            optionalCommonType = 
TypeCoercionUtils.findWiderCommonType(dataTypesForCoercion, false, true);
         } else {
             optionalCommonType = 
TypeCoercionUtils.findWiderCommonTypeForCaseWhen(dataTypesForCoercion);
         }
@@ -1527,29 +1540,31 @@ public class TypeCoercionUtils {
      * find wider common type for input data types.
      * @return return a type if find one, return Optional.empty() if not find
      */
-    public static Optional<DataType> findWiderCommonType(List<DataType> 
dataTypes, boolean overflowToDouble) {
+    public static Optional<DataType> findWiderCommonType(List<DataType> 
dataTypes,
+            boolean overflowToDouble, boolean stringIsHighPriority) {
         return 
dataTypes.stream().map(Optional::of).reduce(Optional.of(NullType.INSTANCE),
                 (r, c) -> {
                     if (r.isPresent() && c.isPresent()) {
-                        return findWiderTypeForTwo(r.get(), c.get(), 
overflowToDouble);
+                        return findWiderTypeForTwo(r.get(), c.get(), 
overflowToDouble, stringIsHighPriority);
                     } else {
                         return Optional.empty();
                     }
                 });
     }
 
-    public static Optional<DataType> 
findWiderCommonTypeByVariable(List<DataType> dataTypes, boolean 
overflowToDouble) {
+    public static Optional<DataType> 
findWiderCommonTypeByVariable(List<DataType> dataTypes,
+                   boolean overflowToDouble, boolean stringIsHighPriority) {
         if (GlobalVariable.enableNewTypeCoercionBehavior) {
-            return findWiderCommonType(dataTypes, overflowToDouble);
+            return findWiderCommonType(dataTypes, overflowToDouble, 
stringIsHighPriority);
         } else {
             return findWiderCommonTypeForCaseWhen(dataTypes);
         }
     }
 
-    public static Optional<DataType> findWiderTypeForTwoByVariable(
-            DataType left, DataType right, boolean overflowToDouble) {
+    public static Optional<DataType> findWiderTypeForTwoByVariable(DataType 
left, DataType right,
+                   boolean overflowToDouble, boolean stringIsHighPriority) {
         if (GlobalVariable.enableNewTypeCoercionBehavior) {
-            return findWiderTypeForTwo(left, right, overflowToDouble);
+            return findWiderTypeForTwo(left, right, overflowToDouble, 
stringIsHighPriority);
         } else {
             return findWiderTypeForTwoForCaseWhen(left, right);
         }
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionMatrixTest.java
 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionMatrixTest.java
index daf8817c66c..f6c50eaadeb 100644
--- 
a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionMatrixTest.java
+++ 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionMatrixTest.java
@@ -1266,7 +1266,7 @@ public class TypeCoercionMatrixTest {
         // GreaterThan greaterThan = new GreaterThan(c1, c2);
         // equalTo = (EqualTo) 
TypeCoercionUtils.processComparisonPredicate(equalTo);
         // greaterThan = (GreaterThan) 
TypeCoercionUtils.processComparisonPredicate(greaterThan);
-        Optional<DataType> result = 
TypeCoercionUtils.findWiderTypeForTwo(leftType, rightType, false);
+        Optional<DataType> result = 
TypeCoercionUtils.findWiderTypeForTwo(leftType, rightType, false, false);
         Assertions.assertEquals(Optional.ofNullable(commonType), result);
     }
 }
diff --git 
a/regression-test/data/correctness_p0/test_outer_join_with_window_function.out 
b/regression-test/data/correctness_p0/test_outer_join_with_window_function.out
index a3650845106..e0d7861228e 100644
Binary files 
a/regression-test/data/correctness_p0/test_outer_join_with_window_function.out 
and 
b/regression-test/data/correctness_p0/test_outer_join_with_window_function.out 
differ
diff --git 
a/regression-test/data/correctness_p0/test_outer_join_with_window_function_datev2.out
 
b/regression-test/data/correctness_p0/test_outer_join_with_window_function_datev2.out
index a3650845106..e0d7861228e 100644
Binary files 
a/regression-test/data/correctness_p0/test_outer_join_with_window_function_datev2.out
 and 
b/regression-test/data/correctness_p0/test_outer_join_with_window_function_datev2.out
 differ
diff --git 
a/regression-test/data/datatype_p0/float/test_float_special_values.out 
b/regression-test/data/datatype_p0/float/test_float_special_values.out
index cf16133caa4..0a219b963f4 100644
Binary files 
a/regression-test/data/datatype_p0/float/test_float_special_values.out and 
b/regression-test/data/datatype_p0/float/test_float_special_values.out differ
diff --git a/regression-test/data/doc/sql-manual/ArrayNullsafe.out 
b/regression-test/data/doc/sql-manual/ArrayNullsafe.out
index c3efb33cfef..681d18859b4 100644
Binary files a/regression-test/data/doc/sql-manual/ArrayNullsafe.out and 
b/regression-test/data/doc/sql-manual/ArrayNullsafe.out differ
diff --git 
a/regression-test/data/doc/sql-manual/basic-elements/data-types/array-md.out 
b/regression-test/data/doc/sql-manual/basic-elements/data-types/array-md.out
index 759aa9a9cb7..2839ff156fa 100644
Binary files 
a/regression-test/data/doc/sql-manual/basic-elements/data-types/array-md.out 
and 
b/regression-test/data/doc/sql-manual/basic-elements/data-types/array-md.out 
differ
diff --git a/regression-test/data/nereids_function_p0/type_coercion.out 
b/regression-test/data/nereids_function_p0/type_coercion.out
index 8ad528ab3cc..747797d67ca 100644
Binary files a/regression-test/data/nereids_function_p0/type_coercion.out and 
b/regression-test/data/nereids_function_p0/type_coercion.out differ
diff --git 
a/regression-test/data/nereids_p0/sql_functions/conditional_functions/test_coalesce.out
 
b/regression-test/data/nereids_p0/sql_functions/conditional_functions/test_coalesce.out
index ead378147d8..dc4c2d4a5b4 100644
Binary files 
a/regression-test/data/nereids_p0/sql_functions/conditional_functions/test_coalesce.out
 and 
b/regression-test/data/nereids_p0/sql_functions/conditional_functions/test_coalesce.out
 differ
diff --git 
a/regression-test/data/nereids_p0/sql_functions/conditional_functions/test_conditional_function.out
 
b/regression-test/data/nereids_p0/sql_functions/conditional_functions/test_conditional_function.out
index a733196a0f2..6afba07005e 100644
Binary files 
a/regression-test/data/nereids_p0/sql_functions/conditional_functions/test_conditional_function.out
 and 
b/regression-test/data/nereids_p0/sql_functions/conditional_functions/test_conditional_function.out
 differ
diff --git 
a/regression-test/data/nereids_p0/sql_functions/conditional_functions/test_nullif.out
 
b/regression-test/data/nereids_p0/sql_functions/conditional_functions/test_nullif.out
index f6130f70797..9d4b99b7d96 100644
Binary files 
a/regression-test/data/nereids_p0/sql_functions/conditional_functions/test_nullif.out
 and 
b/regression-test/data/nereids_p0/sql_functions/conditional_functions/test_nullif.out
 differ
diff --git a/regression-test/data/nereids_p0/union/test_union.out 
b/regression-test/data/nereids_p0/union/test_union.out
index 3a59fbc7248..08a4085dae1 100644
Binary files a/regression-test/data/nereids_p0/union/test_union.out and 
b/regression-test/data/nereids_p0/union/test_union.out differ
diff --git 
a/regression-test/data/nereids_rules_p0/infer_predicate/infer_intersect_except.out
 
b/regression-test/data/nereids_rules_p0/infer_predicate/infer_intersect_except.out
index a8af1bce56c..5c1abbb7e34 100644
Binary files 
a/regression-test/data/nereids_rules_p0/infer_predicate/infer_intersect_except.out
 and 
b/regression-test/data/nereids_rules_p0/infer_predicate/infer_intersect_except.out
 differ
diff --git 
a/regression-test/data/nereids_rules_p0/infer_predicate/pull_up_predicate_set_op.out
 
b/regression-test/data/nereids_rules_p0/infer_predicate/pull_up_predicate_set_op.out
index bf5cf8dc0da..a7ac6765f62 100644
Binary files 
a/regression-test/data/nereids_rules_p0/infer_predicate/pull_up_predicate_set_op.out
 and 
b/regression-test/data/nereids_rules_p0/infer_predicate/pull_up_predicate_set_op.out
 differ
diff --git 
a/regression-test/data/nereids_rules_p0/simplify_conditional_function/simplify_conditional_function.out
 
b/regression-test/data/nereids_rules_p0/simplify_conditional_function/simplify_conditional_function.out
index d605691b30e..70b4975e912 100644
Binary files 
a/regression-test/data/nereids_rules_p0/simplify_conditional_function/simplify_conditional_function.out
 and 
b/regression-test/data/nereids_rules_p0/simplify_conditional_function/simplify_conditional_function.out
 differ
diff --git a/regression-test/data/nereids_syntax_p0/set_operation.out 
b/regression-test/data/nereids_syntax_p0/set_operation.out
index 7456f9133d4..5afc4fac2ad 100644
Binary files a/regression-test/data/nereids_syntax_p0/set_operation.out and 
b/regression-test/data/nereids_syntax_p0/set_operation.out differ
diff --git 
a/regression-test/data/nereids_syntax_p0/sql/test_compare_expression.out 
b/regression-test/data/nereids_syntax_p0/sql/test_compare_expression.out
index cd1b9de3944..7f4f2d231be 100644
Binary files 
a/regression-test/data/nereids_syntax_p0/sql/test_compare_expression.out and 
b/regression-test/data/nereids_syntax_p0/sql/test_compare_expression.out differ
diff --git a/regression-test/data/query_p0/cast/test_complextype_to_json.out 
b/regression-test/data/query_p0/cast/test_complextype_to_json.out
index 2018dab6b1a..719027a3824 100644
Binary files a/regression-test/data/query_p0/cast/test_complextype_to_json.out 
and b/regression-test/data/query_p0/cast/test_complextype_to_json.out differ
diff --git 
a/regression-test/data/query_p0/sql_functions/array_functions/sql/q02.out 
b/regression-test/data/query_p0/sql_functions/array_functions/sql/q02.out
index 14ba6ea9d57..8b13cf1e8dd 100644
Binary files 
a/regression-test/data/query_p0/sql_functions/array_functions/sql/q02.out and 
b/regression-test/data/query_p0/sql_functions/array_functions/sql/q02.out differ
diff --git 
a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out
 
b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out
index 0aa3c154881..42ee0d71f21 100644
Binary files 
a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out
 and 
b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out
 differ
diff --git 
a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_by_literal.out
 
b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_by_literal.out
index 3ef5ebc2542..6584aaabaf3 100644
Binary files 
a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_by_literal.out
 and 
b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_by_literal.out
 differ
diff --git 
a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_with_where.out
 
b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_with_where.out
index a79b7032b13..d865ded038c 100644
Binary files 
a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_with_where.out
 and 
b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_with_where.out
 differ
diff --git 
a/regression-test/data/query_p0/sql_functions/conditional_functions/test_coalesce.out
 
b/regression-test/data/query_p0/sql_functions/conditional_functions/test_coalesce.out
index ead378147d8..dc4c2d4a5b4 100644
Binary files 
a/regression-test/data/query_p0/sql_functions/conditional_functions/test_coalesce.out
 and 
b/regression-test/data/query_p0/sql_functions/conditional_functions/test_coalesce.out
 differ
diff --git 
a/regression-test/data/query_p0/sql_functions/conditional_functions/test_conditional_function.out
 
b/regression-test/data/query_p0/sql_functions/conditional_functions/test_conditional_function.out
index 83a491bf27e..299b946303a 100644
Binary files 
a/regression-test/data/query_p0/sql_functions/conditional_functions/test_conditional_function.out
 and 
b/regression-test/data/query_p0/sql_functions/conditional_functions/test_conditional_function.out
 differ
diff --git 
a/regression-test/data/query_p0/sql_functions/conditional_functions/test_nullif.out
 
b/regression-test/data/query_p0/sql_functions/conditional_functions/test_nullif.out
index df4982187c6..6a9c1d8366f 100644
Binary files 
a/regression-test/data/query_p0/sql_functions/conditional_functions/test_nullif.out
 and 
b/regression-test/data/query_p0/sql_functions/conditional_functions/test_nullif.out
 differ
diff --git a/regression-test/data/query_p0/union/test_union.out 
b/regression-test/data/query_p0/union/test_union.out
index 2f2d0968679..2591dc43c56 100644
Binary files a/regression-test/data/query_p0/union/test_union.out and 
b/regression-test/data/query_p0/union/test_union.out differ
diff --git a/regression-test/suites/nereids_p0/datatype/test_cast.groovy 
b/regression-test/suites/nereids_p0/datatype/test_cast.groovy
index 679f93e4865..a28bbb477c9 100644
--- a/regression-test/suites/nereids_p0/datatype/test_cast.groovy
+++ b/regression-test/suites/nereids_p0/datatype/test_cast.groovy
@@ -64,7 +64,7 @@ suite("test_cast") {
 
     test {
         sql "select * from ${tbl} where case when k0 = 101 then '12' else 0 
end"
-        result([[101]])
+        result([])
     }
 
     test {
diff --git 
a/regression-test/suites/nereids_p0/datatype/test_date_implicit_cast.groovy 
b/regression-test/suites/nereids_p0/datatype/test_date_implicit_cast.groovy
index 2880b0634a0..e7f52410785 100644
--- a/regression-test/suites/nereids_p0/datatype/test_date_implicit_cast.groovy
+++ b/regression-test/suites/nereids_p0/datatype/test_date_implicit_cast.groovy
@@ -38,7 +38,7 @@ suite("test_date_implicit_cast") {
         if (value.contains("col=k1, colUniqueId=0, type=datetimev2(4)")) {
             contain0 = true;
         }
-        if (value.contains("col=null, colUniqueId=null, type=datetimev2(4)")) {
+        if (value.contains("col=null, colUniqueId=null, type=text")) {
             contain1 = true;
         }
     }
@@ -61,7 +61,7 @@ suite("test_date_implicit_cast") {
         if (value.contains("col=k1, colUniqueId=0, type=datetimev2(4)")) {
             contain0 = true;
         }
-        if (value.contains("col=null, colUniqueId=null, type=datetimev2(5)")) {
+        if (value.contains("col=null, colUniqueId=null, type=text")) {
             contain1 = true;
         }
     }
@@ -80,7 +80,7 @@ suite("test_date_implicit_cast") {
         if (value.contains("col=k1, colUniqueId=0, type=datetimev2(6)")) {
             contain0 = true;
         }
-        if (value.contains("col=null, colUniqueId=null, type=datetimev2(6)")) {
+        if (value.contains("col=null, colUniqueId=null, type=text")) {
             contain1 = true;
         }
     }
diff --git 
a/regression-test/suites/nereids_p0/expression/fold_constant/fold_constant_by_be.groovy
 
b/regression-test/suites/nereids_p0/expression/fold_constant/fold_constant_by_be.groovy
index 46a8503731d..a8c538e6256 100644
--- 
a/regression-test/suites/nereids_p0/expression/fold_constant/fold_constant_by_be.groovy
+++ 
b/regression-test/suites/nereids_p0/expression/fold_constant/fold_constant_by_be.groovy
@@ -34,7 +34,7 @@ suite("fold_constant_by_be") {
                 curdate(),
                 DATE_FORMAT(DATE_SUB(month_ceil(CONCAT_WS('', '9999-07', 
'-26')), 1), '%Y-%m-%d'))
         '''
-        result([[LocalDateTime.of(9999, 7, 31, 0, 0)]])
+        result([["9999-07-31"]])
     }
 
     sql """
diff --git a/regression-test/suites/query_p0/cast/test_cast.groovy 
b/regression-test/suites/query_p0/cast/test_cast.groovy
index 28744e1ccd0..435414f3b0d 100644
--- a/regression-test/suites/query_p0/cast/test_cast.groovy
+++ b/regression-test/suites/query_p0/cast/test_cast.groovy
@@ -133,7 +133,7 @@ suite('test_cast', "arrow_flight_sql") {
 
     test {
         sql "select * from ${tbl} where case when k0 = 101 then '12' else 0 
end"
-        result([[101]])
+        result([])
     }
 
     test {
@@ -142,7 +142,7 @@ suite('test_cast', "arrow_flight_sql") {
     }
 
     test {
-        sql "select * from ${tbl} where case when k0 = 101 then true else 1 
end"
+        sql "select * from ${tbl} where case when k0 = 101 then 'true' else 1 
end"
         result([[101]])
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to