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

    https://github.com/apache/spark/pull/8494#discussion_r43467362
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala
 ---
    @@ -135,16 +135,25 @@ abstract class LogicalPlan extends 
QueryPlan[LogicalPlan] with Logging {
       /** Args that have cleaned such that differences in expression id should 
not affect equality */
       protected lazy val cleanArgs: Seq[Any] = {
         val input = children.flatMap(_.output)
    +    def cleanExpression(e: Expression) = e match {
    +      case a: Alias =>
    +        // As the root of the expression, Alias will always take an 
arbitrary exprId, we need
    +        // to erase that for equality testing.
    +        val cleanedExprId = Alias(a.child, a.name)(ExprId(-1), 
a.qualifiers)
    +        BindReferences.bindReference(cleanedExprId, input, allowFailures = 
true)
    +      case other => BindReferences.bindReference(other, input, 
allowFailures = true)
    +    }
    +
         productIterator.map {
    --- End diff --
    
    Would it make sense to use `transformAllExpressions` here instead of 
enumerating all possible ways of how expressions may occur in the logical plan, 
or would that produce a different result?


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