ferhatelmas commented on code in PR #666:
URL: https://github.com/apache/iceberg-go/pull/666#discussion_r2665616396


##########
catalog/internal/utils.go:
##########
@@ -52,18 +54,14 @@ func WriteTableMetadata(metadata table.Metadata, fs 
icebergio.WriteFileIO, loc s
        case table.MetadataCompressionCodecGzip:
                compressWriter = gzip.NewWriter(out)
                writer = compressWriter
+               defer internal.CheckedClose(compressWriter, &err)
        default:
                return fmt.Errorf("unsupported write metadata compression 
codec: %s", compression)

Review Comment:
   Change seems correct functionally. 
   
   If it's fine to refactor a bit, I would move validation to the top so that 
if wrong input codec is given, it can skip creating a writer and closing it 
completely, instead return early 



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