HyukjinKwon commented on a change in pull request #25006: [SPARK-28208][BUILD] 
Upgrade to ORC 1.5.6 including closing the ORC readers
URL: https://github.com/apache/spark/pull/25006#discussion_r298788206
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala
 ##########
 @@ -184,6 +184,7 @@ class OrcFileFormat
 
       val requestedColIdsOrEmptyFile = OrcUtils.requestedColumnIds(
         isCaseSensitive, dataSchema, requiredSchema, reader, conf)
+      reader.close()
 
 Review comment:
   Can we do:
   
   ```scala
         val requestedColIdsOrEmptyFile = {
           Utils.tryWithResource(OrcFile.createReader(filePath, readerOptions)) 
{ reader =>
             OrcUtils.requestedColumnIds(
               isCaseSensitive, dataSchema, requiredSchema, reader, conf)
           }
         }
   ```
   
   or, `try` and `finally`?
   
   ?

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