englefly commented on code in PR #19013:
URL: https://github.com/apache/doris/pull/19013#discussion_r1176115500
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnBE.java:
##########
@@ -101,7 +101,7 @@ private Expression foldByBE(Expression root,
ExpressionRewriteContext context) {
private Expression replace(Expression root, Map<String, Expression>
constMap, Map<String, Expression> resultMap) {
for (Entry<String, Expression> entry : constMap.entrySet()) {
if (entry.getValue().equals(root)) {
- return resultMap.get(entry.getKey());
+ return resultMap.getOrDefault(entry.getKey(), root);
Review Comment:
the problem is why resultMap does not contain entry.getKey().
if we return root, it means fold-const feature failed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]