You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "LeonidChistov (via GitHub)" <gi...@apache.org> on 2023/04/20 12:05:52 UTC

[GitHub] [calcite] LeonidChistov commented on a diff in pull request #3149: [CALCITE-5646] JoinDeriveIsNotNullFilterRule incorrectly handles COAESCE in join condition

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


##########
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:
   Yes, sorry. Thanks for corrections.



##########
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:
   Agreed.



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org