shahidki31 commented on a change in pull request #25460: 
[SPARK-25474][SQL][FOLLOW-UP] fallback to hdfs when relation table stats is not 
available
URL: https://github.com/apache/spark/pull/25460#discussion_r314274591
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/HadoopFsRelation.scala
 ##########
 @@ -72,7 +72,8 @@ case class HadoopFsRelation(
     val compressionFactor = sqlContext.conf.fileCompressionFactor
     val defaultSize = (location.sizeInBytes * compressionFactor).toLong
     location match {
-      case cfi: CatalogFileIndex if 
sparkSession.sessionState.conf.fallBackToHdfsForStatsEnabled =>
+      case cfi: CatalogFileIndex if 
sparkSession.sessionState.conf.fallBackToHdfsForStatsEnabled
+        && defaultSize == sqlContext.conf.defaultSizeInBytes =>
 
 Review comment:
   @wangyum 
   default size is coming as Long.MAX. If it is correct size it will not 
fallback to HDFS. Even if it is correct size, fallbackhdfs also give the same 
result. Also it is not a performance sensitive path I guess. Because, it will 
come here only when it requires to compute statistics, for eg: during join 
operation. And if the table already has statistics, flow will not come here.

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