Skip to content

Commit 68decd1

Browse files
committed
reorder it.
1 parent a31b1b5 commit 68decd1

File tree

1 file changed

+2
-5
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer

1 file changed

+2
-5
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)