File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 18
18
package org .apache .spark .sql .catalyst .analysis
19
19
20
20
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 }
22
22
import org .apache .spark .sql .catalyst .rules .Rule
23
23
24
24
/**
@@ -53,7 +53,14 @@ import org.apache.spark.sql.catalyst.rules.Rule
53
53
* completely resolved during the batch of Resolution.
54
54
*/
55
55
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 {
57
64
// The child has the different output attributes with the View operator. Adds a Project over
58
65
// the child of the view.
59
66
case v @ View (Some (desc), _, output, child) if child.resolved && ! v.sameOutput(child) =>
You can’t perform that action at this time.
0 commit comments