You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/05/08 05:48:36 UTC

[GitHub] [spark] wangyum commented on a change in pull request #24551: [SPARK-27655][SQL] Persistent the table statistics to metadata after fall back to hdfs

wangyum commented on a change in pull request #24551: [SPARK-27655][SQL] Persistent the table statistics to metadata after fall back to hdfs
URL: https://github.com/apache/spark/pull/24551#discussion_r281920773
 
 

 ##########
 File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala
 ##########
 @@ -117,19 +118,29 @@ class DetermineTableStats(session: SparkSession) extends Rule[LogicalPlan] {
     case relation: HiveTableRelation
         if DDLUtils.isHiveTable(relation.tableMeta) && relation.tableMeta.stats.isEmpty =>
       val table = relation.tableMeta
-      val sizeInBytes = if (session.sessionState.conf.fallBackToHdfsForStatsEnabled) {
+      val sessionState = session.sessionState
+      val sizeInBytes = if (sessionState.conf.fallBackToHdfsForStatsEnabled) {
         try {
-          val hadoopConf = session.sessionState.newHadoopConf()
+          val hadoopConf = sessionState.newHadoopConf()
           val tablePath = new Path(table.location)
           val fs: FileSystem = tablePath.getFileSystem(hadoopConf)
-          fs.getContentSummary(tablePath).getLength
+          val newSize = fs.getContentSummary(tablePath).getLength
+
+          if (sessionState.conf.persistentStatsAfterFallBackEnabled) {
+            val threadName = s"update-${table.identifier.unquotedString}-stats"
+            ThreadUtils.runInNewThread(threadName, isJoin = false) {
 
 Review comment:
   Set `isJoin = false`: Do not wait for this thread to die.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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