[fix](nereids)prevent null pointer access if translate expression fails (#33990)

This commit is contained in:
starocean999
2024-04-26 09:26:36 +08:00
committed by yiguolei
parent 60e20a3afe
commit fdf91759b6

View File

@ -215,6 +215,11 @@ public class FoldConstantRuleOnBE implements ExpressionPatternRuleFactory {
LOG.warn("expression {} translate to legacy expr failed. ", expr, e);
return;
}
if (staleExpr == null) {
// just return, it's a fail-safe
LOG.warn("expression {} translate to legacy expr failed. ", expr);
return;
}
tExprMap.put(id, staleExpr.treeToThrift());
} else {
for (int i = 0; i < expr.children().size(); i++) {