aokolnychyi commented on a change in pull request #30577:
URL: https://github.com/apache/spark/pull/30577#discussion_r535023879



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/SparkSessionExtensions.scala
##########
@@ -199,6 +199,21 @@ class SparkSessionExtensions {
     optimizerRules += builder
   }
 
+  private[this] val dataSourceRewriteRules = mutable.Buffer.empty[RuleBuilder]
+
+  private[sql] def buildDataSourceRewriteRules(session: SparkSession): 
Seq[Rule[LogicalPlan]] = {
+    dataSourceRewriteRules.map(_.apply(session))

Review comment:
       @HyukjinKwon, I believe you are right this issue may happen if we switch 
from `mutable.Buffer` to something else in the future but I think we should 
update all places in `SparkSessionExtensions` if we want to fix it now. In this 
PR, I match the existing behavior for all other rules like 
`resolutionRuleBuilders` except calling `toSeq` like @LuciferYang pointed.
   
   I'll add `toSeq` at the end to match all other places.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to