From eb8ecf49bf07e7292fde4641920a1acdb731c267 Mon Sep 17 00:00:00 2001 From: starocean999 <40539150+starocean999@users.noreply.github.com> Date: Fri, 15 Sep 2023 14:12:06 +0800 Subject: [PATCH] [fix](planner) should set preserveRootTypes to true when call substituteList method in ExprSubstitutionMap's compose method (#24392) if set preserveRootTypes to false when calling substituteList, the root cast expr may be lost during substituting. For example, the top cast expr is cast(decimal_col as double), if it's lost, the data type mismatch between plan node and be crashes. --- .../java/org/apache/doris/analysis/ExprSubstitutionMap.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/ExprSubstitutionMap.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/ExprSubstitutionMap.java index 5c346ef576..e6e50f7321 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/ExprSubstitutionMap.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/ExprSubstitutionMap.java @@ -160,7 +160,7 @@ public final class ExprSubstitutionMap { ExprSubstitutionMap result = new ExprSubstitutionMap(); // f's substitution targets need to be substituted via g result.lhs = Expr.cloneList(f.lhs); - result.rhs = Expr.substituteList(f.rhs, g, analyzer, false); + result.rhs = Expr.substituteList(f.rhs, g, analyzer, true); // substitution maps are cumulative: the combined map contains all // substitutions from f and g.