dongjoon-hyun commented on a change in pull request #22502: [SPARK-25474][SQL] 
When the "fallBackToHdfsForStats= true", Size in bytes is coming as default 
size in bytes ( 8.0 EB)
URL: https://github.com/apache/spark/pull/22502#discussion_r307981895
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/HadoopFsRelation.scala
 ##########
 @@ -71,7 +73,13 @@ case class HadoopFsRelation(
 
   override def sizeInBytes: Long = {
     val compressionFactor = sqlContext.conf.fileCompressionFactor
-    (location.sizeInBytes * compressionFactor).toLong
+    val defaultSize = (location.sizeInBytes * compressionFactor).toLong
+    location match {
+      case cfi: CatalogFileIndex if 
sparkSession.sessionState.conf.fallBackToHdfsForStatsEnabled =>
+        CommandUtils.getSizeInBytesFallBackToHdfs(sparkSession, new 
Path(cfi.table.location),
 
 Review comment:
   @shahidki31 . 
   Although `fallBackToHdfsForStatsEnable=true`, this function should be 
invoked only when there is no available statistics. In this PR, this seems to 
be invoked blindly. Could you add another test case to make it sure that we 
don't call this function when the statistics exists. For example, after 
executing `analyze table t1 compute statistics;`?

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

Reply via email to