[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:
starocean999
2023-09-15 14:12:06 +08:00
committed by GitHub
parent ddc0eb3508
commit eb8ecf49bf

View File

@ -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.