HyukjinKwon commented on a change in pull request #33956:
URL: https://github.com/apache/spark/pull/33956#discussion_r706729762



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/QueryPlanConstraints.scala
##########
@@ -33,7 +33,8 @@ trait QueryPlanConstraints extends ConstraintHelper { self: 
LogicalPlan =>
         .union(inferAdditionalConstraints(validConstraints))
         .union(constructIsNotNullConstraints(validConstraints, output))
         .filter { c =>
-          c.references.nonEmpty && c.references.subsetOf(outputSet) && 
c.deterministic
+          (c.references.nonEmpty && c.references.subsetOf(outputSet) || 
c.references.isEmpty) &&

Review comment:
       Hm, it's a bit weird that we consider the constraints are valid even for 
the constraint that holds the reference not being referred. Shouldn't we handle 
it in `InferFiltersFromGenerate` rule itself?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to