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

    https://github.com/apache/spark/pull/17541#discussion_r110562951
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala 
---
    @@ -359,9 +359,59 @@ abstract class QueryPlan[PlanType <: 
QueryPlan[PlanType]] extends TreeNode[PlanT
       override protected def innerChildren: Seq[QueryPlan[_]] = subqueries
     
       /**
    -   * Canonicalized copy of this query plan.
    +   * Returns a plan where a best effort attempt has been made to transform 
`this` in a way
    +   * that preserves the result but removes cosmetic variations (case 
sensitivity, ordering for
    +   * commutative operations, expression id, etc.)
    +   *
    +   * Plans where `this.canonicalized == other.canonicalized` will always 
evaluate to the same
    +   * result.
    +   *
    +   * Some nodes should overwrite this to provide proper canonicalize logic.
    +   */
    +  lazy val canonicalized: PlanType = {
    +    val canonicalizedChildren = children.map(_.canonicalized)
    +    var id = -1
    +    preCanonicalized.mapExpressions {
    --- End diff --
    
    Do we need to consider non-deterministic expressions?


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