Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/20670#discussion_r170529019
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/QueryPlanConstraints.scala
---
@@ -29,12 +29,26 @@ trait QueryPlanConstraints { self: LogicalPlan =>
*/
lazy val constraints: ExpressionSet = {
if (conf.constraintPropagationEnabled) {
+ var relevantOutPutSet: AttributeSet = outputSet
+ constraints.foreach {
+ case eq @ EqualTo(l: Attribute, r: Attribute) =>
+ if (l.references.subsetOf(relevantOutPutSet)
--- End diff --
You can avoid computing each `subsetOf` twice here.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]