aokolnychyi commented on a change in pull request #30808:
URL: https://github.com/apache/spark/pull/30808#discussion_r544465441
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/SparkSessionExtensions.scala
##########
@@ -200,19 +200,20 @@ class SparkSessionExtensions {
optimizerRules += builder
}
- private[this] val dataSourceRewriteRules = mutable.Buffer.empty[RuleBuilder]
+ private[this] val postOperatorOptimizationRules =
mutable.Buffer.empty[RuleBuilder]
- private[sql] def buildDataSourceRewriteRules(session: SparkSession):
Seq[Rule[LogicalPlan]] = {
- dataSourceRewriteRules.map(_.apply(session)).toSeq
+ private[sql] def buildPostOperatorOptimizationRules(
+ session: SparkSession): Seq[Rule[LogicalPlan]] = {
+ postOperatorOptimizationRules.map(_.apply(session)).toSeq
}
/**
- * Inject an optimizer `Rule` builder that rewrites data source plans into
the [[SparkSession]].
+ * Inject an optimizer `Rule` builder that rewrites logical plans into the
[[SparkSession]].
* The injected rules will be executed after the operator optimization batch
and before rules
* that depend on stats.
*/
- def injectDataSourceRewriteRule(builder: RuleBuilder): Unit = {
- dataSourceRewriteRules += builder
+ def injectPostOperatorOptimizationRule(builder: RuleBuilder): Unit = {
Review comment:
This isn't final.
I'll explain my current thinking here. We are going to use this batch to
rewrite plans directly after operator optimization. I did not go for
`planRewriteRules` due to the
[comment](https://github.com/apache/spark/pull/30558#discussion_r533151935)
made by @dongjoon-hyun and @viirya (please let me know if you don't feel that
way anymore). I also did not go for `preCBORules` as there quite a few things
that will happen before CBO like discussed in the original thread.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]