HyukjinKwon commented on a change in pull request #27031: [SPARK-30373][SQL] 
Avoid unnecessary sort for ParquetUtils.splitFiles
URL: https://github.com/apache/spark/pull/27031#discussion_r361917663
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetUtils.scala
 ##########
 @@ -112,15 +114,26 @@ object ParquetUtils {
       metadata: Seq[FileStatus],
       commonMetadata: Seq[FileStatus])
 
-  private def splitFiles(allFiles: Seq[FileStatus]): FileTypes = {
-    val leaves = allFiles.toArray.sortBy(_.getPath.toString)
 
 Review comment:
   Also, IIRC, `sortBy` uses Timsort under the hood which gives you linear time 
complexity when the input is already sorted, which I believe are in most cases 
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