Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
imback82 committed Jan 28, 2021
1 parent f2b86a9 commit bfabe9f
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.spark.sql.catalyst.analysis

import org.apache.spark.sql.catalyst.expressions.Alias
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Project, View}
import org.apache.spark.sql.catalyst.plans.logical.{AnalysisHelper, LogicalPlan, Project, View}
import org.apache.spark.sql.catalyst.rules.Rule

/**
Expand Down Expand Up @@ -53,7 +53,14 @@ import org.apache.spark.sql.catalyst.rules.Rule
* completely resolved during the batch of Resolution.
*/
object EliminateView extends Rule[LogicalPlan] with CastSupport {
override def apply(plan: LogicalPlan): LogicalPlan = plan transformUp {
// Temporary fix until https://github.com/apache/spark/pull/31368 is merged.
override def apply(plan: LogicalPlan): LogicalPlan = {
AnalysisHelper.allowInvokingTransformsInAnalyzer {
applyInternal(plan)
}
}

private def applyInternal(plan: LogicalPlan): LogicalPlan = plan transformUp {
// The child has the different output attributes with the View operator. Adds a Project over
// the child of the view.
case v @ View(Some(desc), _, output, child) if child.resolved && !v.sameOutput(child) =>
Expand Down

0 comments on commit bfabe9f

Please sign in to comment.