File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -380,15 +380,12 @@ object ColumnPruning extends Rule[LogicalPlan] {
380380 p
381381 }
382382
383- // Eliminate the Projects with empty projectList
384- case p @ Project (projectList, child) if projectList.isEmpty => child
383+ // Eliminate no-op Projects
384+ case p @ Project (projectList, child) if sameOutput(child.output, p.output) => child
385385
386386 // Can't prune the columns on LeafNode
387387 case p @ Project (_, l : LeafNode ) => p
388388
389- // Eliminate no-op Projects
390- case p @ Project (projectList, child) if sameOutput(child.output, p.output) => child
391-
392389 // for all other logical plans that inherits the output from it's children
393390 case p @ Project (_, child) =>
394391 val required = child.references ++ p.references
You can’t perform that action at this time.
0 commit comments