zabetak commented on code in PR #3149:
URL: https://github.com/apache/calcite/pull/3149#discussion_r1172395262


##########
core/src/main/java/org/apache/calcite/plan/Strong.java:
##########
@@ -149,7 +149,9 @@ public static boolean allStrong(List<RexNode> operands) {
     return operands.stream().allMatch(Strong::isStrong);
   }
 
-  /** Returns whether an expression is definitely not true. */
+  /** Returns whether the analyzed expression will definitely not return true
+   * (equivalently, will definitely not return null or false) if

Review Comment:
   The javadoc here was rather fine. The part that is broken is L82 
`(equivalently, will definitely not return null or false)`. It should be 
`(equivalently, will definitely return null or false)`.



##########
core/src/main/java/org/apache/calcite/rel/rules/JoinDeriveIsNotNullFilterRule.java:
##########
@@ -62,9 +62,9 @@ public JoinDeriveIsNotNullFilterRule(Config config) {
     final RelMetadataQuery mq = call.getMetadataQuery();
 
     final ImmutableBitSet.Builder notNullableKeys = ImmutableBitSet.builder();
-    RelOptUtil.conjunctions(join.getCondition()).forEach(node -> {
-      if (Strong.isStrong(node)) {
-        notNullableKeys.addAll(RelOptUtil.InputFinder.bits(node));
+    RelOptUtil.InputFinder.bits(join.getCondition()).forEach(bit -> {
+      if (Strong.of(ImmutableBitSet.of(bit)).isNotTrue(join.getCondition())) {

Review Comment:
   This can also become a bit shorter I guess by using the static util: 
`Strong.isNotTrue(join.getCondition, ImmutableBitSet.of(bit))`



-- 
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]

Reply via email to