ulysses-you commented on a change in pull request #26391: [SPARK-29749][SQL]
Add ParquetScan statistics
URL: https://github.com/apache/spark/pull/26391#discussion_r344493522
##########
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:
Thanks for review. I tried foldLeft and it looks like more complex, use var
maybe more clear. It's a good idea read parquet metadata in parallel, we can
add it if necessary. With the last, I think user does not need to know why file
cannot be opened, or we can just log a warn when meet the fallback option.
----------------------------------------------------------------
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]