HyukjinKwon commented on a change in pull request #30577:
URL: https://github.com/apache/spark/pull/30577#discussion_r534576769
##########
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:
Shall we make it early `map` ? It can be potentially exposed to
SPARK-16694 if we happened to lazily map in the future. We can either use a
concrete return type or call like `.toArray`
e.g.)
```scala
scala> Seq(1, 2).view.map(_ => println("a")).isInstanceOf[Seq[_]]
res0: Boolean = true
scala> Seq(1, 2).map(_ => println("a")).isInstanceOf[Seq[_]]
a
a
res1: Boolean = true
```
----------------------------------------------------------------
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]