You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by viirya <gi...@git.apache.org> on 2016/03/02 04:41:45 UTC

[GitHub] spark pull request: [SPARK-13466][SQL] Don't introduce redundant p...

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

    https://github.com/apache/spark/pull/11341#discussion_r54675632
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala ---
    @@ -382,7 +382,14 @@ object ColumnPruning extends Rule[LogicalPlan] {
           val required = child.references ++ p.references
           if ((child.inputSet -- required).nonEmpty) {
             val newChildren = child.children.map(c => prunedChild(c, required))
    -        p.copy(child = child.withNewChildren(newChildren))
    +        val newChild = child.withNewChildren(newChildren)
    +        val sameOutput = newChild.output.size == p.output.size &&
    +          newChild.output.zip(p.output).forall(pair => pair._1.semanticEquals(pair._2))
    --- End diff --
    
    Using `==` doesn't work here is because the output of child plan has no qualifiers, but the project output has qualifiers `x` and `y`.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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