wgtmac commented on code in PR #1309:
URL: https://github.com/apache/parquet-mr/pull/1309#discussion_r1560346922


##########
parquet-common/src/main/java/org/apache/parquet/io/DelegatingPositionOutputStream.java:
##########
@@ -35,7 +35,11 @@ public OutputStream getStream() {
 
   @Override
   public void close() throws IOException {
-    stream.close();
+    try (OutputStream os = this.stream) {

Review Comment:
   Yes, for example `LittleEndianDataOutputStream` is used by column encoders 
which is accessed via `ValuesWriter.getBytes()` at 
https://github.com/apache/parquet-mr/blob/master/parquet-column/src/main/java/org/apache/parquet/column/values/ValuesWriter.java#L43.
 We can see that `getBytes()` implementations have guaranteed to call flush() 
before consuming the encoded bytes. We don't have to call flush() in the 
close() since the data is not used any more.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to