peter-toth commented on a change in pull request #24495: [SPARK-27604][SQL]
Enhance constant propagation to constraint propagation
URL: https://github.com/apache/spark/pull/24495#discussion_r281601281
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/QueryPlanConstraints.scala
##########
@@ -122,4 +122,193 @@ trait ConstraintHelper {
case _: NullIntolerant =>
expr.children.flatMap(scanNullIntolerantAttribute)
case _ => Seq.empty[Attribute]
}
+
+ def normalizeAndReduceWithConstraints(expression: Expression): Expression =
Review comment:
I think we could extend constraint propagation
(`normalizeAndReduceWithConstraints()`) to Joins in a future PR. I believe it
could work a bit similar to `inferAdditionalConstraints()` does in
`constraints` and also in `InferFiltersFromConstraints` rule.
If you think it is too early to have the logic in `QueryPlanConstraints`
then I can move the logic into `FilterReduction`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]