mihaibudiu commented on code in PR #4315:
URL: https://github.com/apache/calcite/pull/4315#discussion_r2050001975
##########
core/src/main/java/org/apache/calcite/rel/rules/JoinConditionOrExpansionRule.java:
##########
@@ -192,6 +185,27 @@ private boolean isJoinKeyCond(RexCall call, int
leftFieldCount) {
return false;
}
+ private boolean containNonOrOneInputRef(RexNode rex) {
+ RexInputRefCounter counter = new RexInputRefCounter();
+ rex.accept(counter);
+ return counter.inputRefCount < 2;
+ }
+
+ /**
+ * Counts the number of InputRefs in a RexNode expression. */
+ private static class RexInputRefCounter extends RexVisitorImpl<Void> {
+ public int inputRefCount = 0;
Review Comment:
I think an expression like `left.a = left.b` is still "legal", and should be
extracted, because after extraction it can be pushed up to the left input, if I
understand how this expansion will work
--
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]