HyukjinKwon commented on a change in pull request #24715: [SPARK-25474][SQL]
Data source tables support fallback to HDFS for size estimation
URL: https://github.com/apache/spark/pull/24715#discussion_r287629773
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
##########
@@ -256,6 +256,21 @@ class FindDataSourceTable(sparkSession: SparkSession)
extends Rule[LogicalPlan]
}
}
+case class DetermineDataSourceTableStats(session: SparkSession) extends
Rule[LogicalPlan] {
+
+ override def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperators {
+ case logicalRelation @ LogicalRelation(_, _, catalogTable, _) if
catalogTable.nonEmpty &&
+ catalogTable.forall(DDLUtils.isDatasourceTable) &&
catalogTable.forall(_.stats.isEmpty) =>
+ val sizeInBytes = if
(session.sessionState.conf.fallBackToHdfsForStatsEnabled) {
Review comment:
Looks like this code will be a duplicate at
https://github.com/apache/spark/pull/24712. Are there more places that similar
patterns happen? Let's do that PR first and deduplicate it if there are some
more places to deduplicate.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]