Skip to content

Commit

Permalink
Update Optimizer.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
AngersZhuuuu committed Aug 11, 2021
1 parent 84922f5 commit be3e2e1
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -438,8 +438,7 @@ object RemoveRedundantAliases extends Rule[LogicalPlan] {
* Remove no-op operators from the query plan that do not make any modifications.
*/
object RemoveNoopOperators extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
def restoreOriginalOutputNames(
def restoreOriginalOutputNames(
projectList: Seq[NamedExpression],
originalNames: Seq[String]): Seq[NamedExpression] = {
projectList.zip(originalNames).map {
Expand All @@ -449,6 +448,7 @@ object RemoveNoopOperators extends Rule[LogicalPlan] {
}
}

def apply(plan: LogicalPlan): LogicalPlan = plan transform {
// Eliminate no-op Projects
case p @ Project(projectList, child) if child.sameOutput(p) =>
val newChild = child match {
Expand Down

0 comments on commit be3e2e1

Please sign in to comment.