Dwrite commented on code in PR #5418:
URL: https://github.com/apache/calcite/pull/5418#discussion_r4579003171
##########
core/src/main/java/org/apache/calcite/tools/RelBuilder.java:
##########
@@ -1987,6 +1988,18 @@ public RelBuilder filter(Iterable<CorrelationId>
variablesSet,
return this;
}
+ /** Flattens nested AND/OR calls at any depth. */
+ private static RexNode flattenDeep(RexBuilder rexBuilder, RexNode node) {
+ if (RexUtil.isFlat(node)) {
Review Comment:
1.flattenDeep short-circuits on RexUtil.isFlat(node). Does isFlat check the
whole tree, or only the direct operands of the root? If it is only the
root, an expression like AND(a, OR(OR(b, c), d)) would be treated as flat
and returned unchanged, even though the inner OR is nested. Is there a
test for such a mixed case? If not, it would be good to add one.
--
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]