tanmayrauth commented on code in PR #1020:
URL: https://github.com/apache/iceberg-go/pull/1020#discussion_r3203457177
##########
catalog/internal/utils.go:
##########
@@ -55,10 +56,19 @@ func WriteTableMetadata(metadata table.Metadata, fs
icebergio.WriteFileIO, loc s
var writer io.Writer = out
var compressWriter io.WriteCloser
- if compression == table.MetadataCompressionCodecGzip {
+ switch compression {
+ case table.MetadataCompressionCodecGzip:
compressWriter = gzip.NewWriter(out)
writer = compressWriter
defer internal.CheckedClose(compressWriter, &err)
+ case table.MetadataCompressionCodecZstd:
+ enc, zErr := zstd.NewWriter(out)
+ if zErr != nil {
+ return zErr
+ }
+ compressWriter = enc
+ writer = compressWriter
+ defer internal.CheckedClose(compressWriter, &err)
Review Comment:
Good catch, removed the intermediate variable. Also cleaned up the gzip case
the same way while I was at it.
--
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]