shahidki31 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_r315089409
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
 ##########
 @@ -619,3 +619,34 @@ object DataSourceStrategy {
     (nonconvertiblePredicates ++ unhandledPredicates, pushedFilters, 
handledFilters)
   }
 }
+
+
+/**
+ * Defines default table statistics if table statistics are not available.
+ */
+class DetermineTableStats(session: SparkSession) extends Rule[LogicalPlan] {
+
+  private val conf = session.sessionState.conf
+
+  override def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperators {
+    // For the data source table, we only recalculate the table statistics
 
 Review comment:
   Yeah, then there will not be any behavior change between this PR and #22502. 
right?
   Because, it it will check the table stats is empty or not at this line.
   ```
   case logical @ LogicalRelation(_, _, Some(table), _)
         if DDLUtils.isDatasourceTable(table) && table.stats.isEmpty &&
   ```
   In #22502, checking table stats exists here,
   
https://github.com/apache/spark/blob/f999e00e9fc03889106a305eeec6d05b6a2c1de1/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/LogicalRelation.scala#L43-L45
   
   So, the fallback behavior is same in both the PRs, by not considering the 
relation stats and falling back to HDFS if the table size is empty?

----------------------------------------------------------------
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


With regards,
Apache Git Services

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

Reply via email to