zeroshade commented on code in PR #683:
URL: https://github.com/apache/iceberg-go/pull/683#discussion_r2705537934
##########
table/snapshot_producers.go:
##########
@@ -482,20 +491,20 @@ func (sp *snapshotProducer) deleteDataFile(df
iceberg.DataFile) *snapshotProduce
return sp
}
-func (sp *snapshotProducer) newManifestWriter(spec iceberg.PartitionSpec) (_
*iceberg.ManifestWriter, _ string, _ *internal.CountingWriter, err error) {
+func (sp *snapshotProducer) newManifestWriter(spec iceberg.PartitionSpec) (_
*iceberg.ManifestWriter, _ string, _ *internal.CountingWriter, _ io.Closer, err
error) {
out, path, err := sp.newManifestOutput()
if err != nil {
- return nil, "", nil, err
+ return nil, "", nil, nil, err
}
counter := &internal.CountingWriter{W: out}
wr, err := iceberg.NewManifestWriter(sp.txn.meta.formatVersion,
counter, spec,
sp.txn.meta.CurrentSchema(), sp.snapshotID)
Review Comment:
Hmm, so the issue is that closing the manifest writer isn't sufficient to
close the underlying output writer. Could modify the CountingWriter so that it
is an `io.WriteCloser` and propagates a call to `Close` to the underlying
writer, and then update the `ManifestWriter` to properly call close on the
underlying writer when Close is called? That way we don't need to return the
separate closer?
Is that worthwhile over this current solution?
--
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]