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

 ##########
 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:
   Thanks for providing a specific case. But I think that user should really 
need to use `mergeSchema=true` option for such case if there's no guarantee 
that the completed parquet file should always be on top of a directory.
   
   Besides, I believe that there's assuming that schemas should be consistent 
if `mergeSchema=false`. And user should be responsible for the result schema if 
not.
   
   >  In either case, we fall back to any of the first part-file, and just 
assume all schemas are consistent.
   

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