spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] dongjoon-hyun commented on a change in pull request #27293: [SPARK-29938][SQL][FOLLOW-UP] Improve AlterTableAddPartitionCommand
Date Wed, 22 Jan 2020 04:25:07 GMT
dongjoon-hyun commented on a change in pull request #27293: [SPARK-29938][SQL][FOLLOW-UP] Improve
AlterTableAddPartitionCommand
URL: https://github.com/apache/spark/pull/27293#discussion_r369364925
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/CommandUtils.scala
 ##########
 @@ -137,6 +136,38 @@ object CommandUtils extends Logging {
     size
   }
 
+  def calculateLocationsSizes(
+      sparkSession: SparkSession,
+      tid: TableIdentifier,
+      paths: Seq[Option[URI]]): Long = {
+    if (sparkSession.sessionState.conf.parallelFileListingInStatsComputation) {
+      calculateLocationsSizesParallel(sparkSession, paths.map(_.map(new Path(_))))
+    } else {
+      paths.map(p => calculateLocationSize(sparkSession.sessionState, tid, p)).sum
+    }
+  }
+
+  /**
+   * Launch a Job to list all leaf files in `paths` and compute the total size
+   * for each path.
+   * @param sparkSession the [[SparkSession]]
+   * @param paths the Seq of [[Option[Path]]s
 
 Review comment:
   Could you fix the Javadoc ? The ending `]` seems missing here. If possible, please double-check
the generated Java doc.

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


Mime
View raw message