Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20687#discussion_r174606237
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/ComplexTypes.scala
 ---
    @@ -22,54 +22,34 @@ import 
org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
     import org.apache.spark.sql.catalyst.rules.Rule
     
     /**
    -* push down operations into [[CreateNamedStructLike]].
    -*/
    -object SimplifyCreateStructOps extends Rule[LogicalPlan] {
    -  override def apply(plan: LogicalPlan): LogicalPlan = {
    -    plan.transformExpressionsUp {
    -      // push down field extraction
    + * Simplify redundant [[CreateNamedStructLike]], [[CreateArray]] and 
[[CreateMap]] expressions.
    + */
    +object SimplifyExtractValueOps extends Rule[LogicalPlan] {
    +  override def apply(plan: LogicalPlan): LogicalPlan = plan transform { 
case p =>
    +    p.transformExpressionsUp {
    --- End diff --
    
    Expression-level optimizer simplifies both `aggregateExpressions` and 
`groupingExpressions` together. If the target expression exists at somewhere of 
both sides, the simplified expression also exists at the same locations of both 
sides. Given that, `semanticEquals` will work for the updated expressions.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to