[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.
This commit is contained in:
@ -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.
|
||||
|
||||
Reference in New Issue
Block a user