nerush commented on a change in pull request #26391: [SPARK-29749][SQL] Add 
ParquetScan statistics
URL: https://github.com/apache/spark/pull/26391#discussion_r343203769
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetUtils.scala
 ##########
 @@ -107,6 +114,29 @@ object ParquetUtils {
     ParquetFileFormat.mergeSchemasInParallel(filesToTouch, sparkSession)
   }
 
+  def getStatistics(files: Array[String], configuration: Configuration): 
Statistics = {
+    var bytes = 0L
+    var rows = 0L
+    files.foreach { file =>
 
 Review comment:
   We can make statistics collection more functional with `foldLeft` on the 
given array and avoid using a mutable state. Furthermore, is it not reasonable 
to collect it in parallel? Should we have a more proper exception handling when 
file cannot be opened?  

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