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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to