Github user mallman commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16785#discussion_r100364260
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala
 ---
    @@ -314,19 +322,29 @@ abstract class UnaryNode extends LogicalPlan {
        * expressions with the corresponding alias
        */
       protected def getAliasedConstraints(projectList: Seq[NamedExpression]): 
Set[Expression] = {
    -    var allConstraints = child.constraints.asInstanceOf[Set[Expression]]
    -    projectList.foreach {
    -      case a @ Alias(e, _) =>
    -        // For every alias in `projectList`, replace the reference in 
constraints by its attribute.
    -        allConstraints ++= allConstraints.map(_ transform {
    -          case expr: Expression if expr.semanticEquals(e) =>
    -            a.toAttribute
    -        })
    -        allConstraints += EqualNullSafe(e, a.toAttribute)
    -      case _ => // Don't change.
    -    }
    -
    -    allConstraints -- child.constraints
    +    val relativeReferences = AttributeSet(projectList.collect {
    +      case a: Alias => a
    +    }.flatMap(_.references))
    +    val parAllConstraints = 
child.constraints.asInstanceOf[Set[Expression]].filter { constraint =>
    +      constraint.references.intersect(relativeReferences).nonEmpty
    +    }.par
    +    parAllConstraints.tasksupport = UnaryNode.taskSupport
    --- End diff --
    
    Why are we using a custom task support instead of the default (which uses 
the global fork-join executor)?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to