mihaibudiu commented on code in PR #4567:
URL: https://github.com/apache/calcite/pull/4567#discussion_r2395729754
##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -2331,7 +2331,7 @@ private void verify(RexNode before, RexNode simplified,
RexUnknownAs unknownAs)
private RexNode simplifySearch(RexCall call, RexUnknownAs unknownAs) {
assert call.getKind() == SqlKind.SEARCH;
- final RexNode a = call.getOperands().get(0);
+ final RexNode a = simplify(call.getOperands().get(0), unknownAs);
Review Comment:
In general I find it more convenient to have one function call per line -
makes it much easier to use the debugger to see what's going on. So I think
`simplify(a)` should be a separate statement.
##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -2359,7 +2359,7 @@ private RexNode simplifySearch(RexCall call, RexUnknownAs
unknownAs) {
return RexUtil.expandSearch(rexBuilder, null, call);
}
}
- return call;
+ return call.clone(call.type, ImmutableList.of(a,
call.getOperands().get(1)));
Review Comment:
Is there any benefit in not cloning the call if `a` is unchanged?
--
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]