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 2022/02/23 14:50:11 UTC

[GitHub] [spark] srowen commented on a change in pull request #35622: [SPARK-38300][SQL] Refactor `fileToString` and `resourceToBytes` in catalyst.util to de-duplicate codes

srowen commented on a change in pull request #35622:
URL: https://github.com/apache/spark/pull/35622#discussion_r812971363



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/package.scala
##########
@@ -100,6 +70,19 @@ package object util extends Logging {
     file
   }
 
+  private def writeToByteArrayOutputStream(inStream: InputStream): ByteArrayOutputStream =
+    Utils.tryWithResource(new ByteArrayOutputStream) { outStream =>

Review comment:
       This no longer closes the inStream - I think that's good to keep




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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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