attilapiros commented on a change in pull request #26016: [SPARK-24914][SQL]
New statistic to improve data size estimate for columnar storage formats
URL: https://github.com/apache/spark/pull/26016#discussion_r357607262
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcUtils.scala
##########
@@ -46,6 +47,16 @@ object OrcUtils extends Logging {
"ZLIB" -> ".zlib",
"LZO" -> ".lzo")
+ def rawSize(hadoopConf: Configuration, filePath: Path): BigInt = {
+ val fs = filePath.getFileSystem(hadoopConf)
+ val readerOptions = OrcFile.readerOptions(hadoopConf).filesystem(fs)
+ try {
+ Utils.tryWithResource(OrcFile.createReader(filePath,
readerOptions))(_.getRawDataSize)
Review comment:
It uses the column statistics of ORC, see [the relevant part of
ReaderImpl](https://github.com/apache/orc/blob/bf6fc4ffab026e74557c50de9f2a827ddf535bdb/java/core/src/java/org/apache/orc/impl/ReaderImpl.java#L767-L864)
----------------------------------------------------------------
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]