You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/09/12 02:13:47 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #33956: [SPARK-36715][SQL] InferFiltersFromGenerate should correctly infer filter for udf

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: reviews-unsubscribe@spark.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org