mihaibudiu commented on code in PR #4332:
URL: https://github.com/apache/calcite/pull/4332#discussion_r2064225630


##########
core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java:
##########
@@ -3201,6 +3210,57 @@ assert allLessThan(this.oldToNewOutputs.values(),
     }
   }
 
+  /**
+   * This method checks if the field at the given index is non-nullable.
+   */
+  private static boolean isFilterNull(RelNode rel, int index) {
+    RelDataType type = rel.getRowType().getFieldList().get(index).getType();
+    return !type.isNullable() || isFilterNullRecursive(rel, index);
+  }
+
+  private static boolean isFilterNullRecursive(RelNode rel, int index) {
+    if (rel instanceof Project) {

Review Comment:
   Is this necessary for correctness, or is it just an optimization?
   If this is necessary for correctness, something is wrong, because this is 
clearly a conservative approximation, which won't work for other kinds of nodes 
or when an expression is not just a reference to a column.
   If this is an optimization, then you should document it as such.
   



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