You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/24 08:21:26 UTC

[GitHub] [spark] attilapiros commented on a change in pull request #26016: [SPARK-24914][SQL] New statistic to improve data size estimate for columnar storage formats

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_r338440708
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcUtils.scala
 ##########
 @@ -46,6 +47,17 @@ 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 {
+      val reader = OrcFile.createReader(filePath, readerOptions)
 
 Review comment:
   Yes but the `reader.getRawDataSize` is built on the [column statistics](https://github.com/apache/orc/blob/master/java/core/src/java/org/apache/orc/impl/ReaderImpl.java#L785) of the ORC files so this is expected to be an efficient way to calculate the size in memory.  
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org