Skip to content

Commit bfabe9f

Browse files
committed
test fix
1 parent f2b86a9 commit bfabe9f

File tree

1 file changed

+9
-2
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis

1 file changed

+9
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/view.scala

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package org.apache.spark.sql.catalyst.analysis
1919

2020
import org.apache.spark.sql.catalyst.expressions.Alias
21-
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Project, View}
21+
import org.apache.spark.sql.catalyst.plans.logical.{AnalysisHelper, LogicalPlan, Project, View}
2222
import org.apache.spark.sql.catalyst.rules.Rule
2323

2424
/**
@@ -53,7 +53,14 @@ import org.apache.spark.sql.catalyst.rules.Rule
5353
* completely resolved during the batch of Resolution.
5454
*/
5555
object EliminateView extends Rule[LogicalPlan] with CastSupport {
56-
override def apply(plan: LogicalPlan): LogicalPlan = plan transformUp {
56+
// Temporary fix until https://github.com/apache/spark/pull/31368 is merged.
57+
override def apply(plan: LogicalPlan): LogicalPlan = {
58+
AnalysisHelper.allowInvokingTransformsInAnalyzer {
59+
applyInternal(plan)
60+
}
61+
}
62+
63+
private def applyInternal(plan: LogicalPlan): LogicalPlan = plan transformUp {
5764
// The child has the different output attributes with the View operator. Adds a Project over
5865
// the child of the view.
5966
case v @ View(Some(desc), _, output, child) if child.resolved && !v.sameOutput(child) =>

0 commit comments

Comments
 (0)