Skip to content

Commit 65f6e7c

Browse files
committed
Revert "Move some rules into postHocResolutionRules"
This reverts commit 1340862.
1 parent 1340862 commit 65f6e7c

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,7 @@ class Analyzer(
112112
* in an individual batch. This batch is to run right after the normal resolution batch and
113113
* execute its rules in one pass.
114114
*/
115-
def postHocResolutionRules: Seq[Rule[LogicalPlan]] =
116-
ResolveOrdinalInOrderByAndGroupBy ::
117-
ResolveAggAliasInGroupBy ::
118-
ResolveMissingReferences ::
119-
ResolveSubquery ::
120-
ResolveAggregateFunctions ::
121-
Nil
115+
val postHocResolutionRules: Seq[Rule[LogicalPlan]] = Nil
122116

123117
lazy val batches: Seq[Batch] = Seq(
124118
Batch("Hints", fixedPoint,
@@ -141,6 +135,9 @@ class Analyzer(
141135
ResolveUpCast ::
142136
ResolveGroupingAnalytics ::
143137
ResolvePivot ::
138+
ResolveOrdinalInOrderByAndGroupBy ::
139+
ResolveAggAliasInGroupBy ::
140+
ResolveMissingReferences ::
144141
ExtractGenerator ::
145142
ResolveGenerate ::
146143
ResolveFunctions ::
@@ -151,12 +148,13 @@ class Analyzer(
151148
ResolveNaturalAndUsingJoin ::
152149
ExtractWindowExpressions ::
153150
GlobalAggregates ::
151+
ResolveAggregateFunctions ::
154152
TimeWindowing ::
155153
ResolveInlineTables(conf) ::
156154
ResolveTimeZone(conf) ::
157155
TypeCoercion.typeCoercionRules ++
158156
extendedResolutionRules : _*),
159-
Batch("Post-Hoc Resolution", fixedPoint, postHocResolutionRules: _*),
157+
Batch("Post-Hoc Resolution", Once, postHocResolutionRules: _*),
160158
Batch("View", Once,
161159
AliasViewChild(conf)),
162160
Batch("Nondeterministic", Once,

sql/core/src/main/scala/org/apache/spark/sql/internal/BaseSessionStateBuilder.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,10 @@ abstract class BaseSessionStateBuilder(
161161
customResolutionRules
162162

163163
override val postHocResolutionRules: Seq[Rule[LogicalPlan]] =
164-
super.postHocResolutionRules ++ (
165-
PreprocessTableCreation(session) +:
166-
PreprocessTableInsertion(conf) +:
167-
DataSourceAnalysis(conf) +:
168-
customPostHocResolutionRules)
164+
PreprocessTableCreation(session) +:
165+
PreprocessTableInsertion(conf) +:
166+
DataSourceAnalysis(conf) +:
167+
customPostHocResolutionRules
169168

170169
override val extendedCheckRules: Seq[LogicalPlan => Unit] =
171170
PreWriteCheck +:

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionStateBuilder.scala

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,13 @@ class HiveSessionStateBuilder(session: SparkSession, parentState: Option[Session
7474
customResolutionRules
7575

7676
override val postHocResolutionRules: Seq[Rule[LogicalPlan]] =
77-
super.postHocResolutionRules ++ (
78-
new DetermineTableStats(session) +:
79-
RelationConversions(conf, catalog) +:
80-
PreprocessTableCreation(session) +:
81-
PreprocessTableInsertion(conf) +:
82-
DataSourceAnalysis(conf) +:
83-
HiveAnalysis +:
84-
customPostHocResolutionRules)
77+
new DetermineTableStats(session) +:
78+
RelationConversions(conf, catalog) +:
79+
PreprocessTableCreation(session) +:
80+
PreprocessTableInsertion(conf) +:
81+
DataSourceAnalysis(conf) +:
82+
HiveAnalysis +:
83+
customPostHocResolutionRules
8584

8685
override val extendedCheckRules: Seq[LogicalPlan => Unit] =
8786
PreWriteCheck +:

0 commit comments

Comments
 (0)