fallintoplace commented on code in PR #1047:
URL: https://github.com/apache/arrow-go/pull/1047#discussion_r3722311525


##########
arrow/ipc/writer.go:
##########
@@ -136,6 +148,11 @@ func NewWriter(w io.Writer, opts ...Option) *Writer {
 }
 
 func (w *Writer) Close() error {
+       if w.err != nil {
+               w.releaseDictionaries()
+               w.pw = nil
+               return w.err

Review Comment:
   Good catch. The error path was also dropping the payload writer after a 
payload write failure, even though the writer had already started. I updated 
`Close` to call `w.pw.Close()` when `w.started` is true and join any cleanup 
error with the original terminal error. Schema-write failures still skip 
`Close` so we do not emit EOS after a partial schema. Added a regression test 
and pushed it in 
[75b990e3](https://github.com/fallintoplace/arrow-go/commit/75b990e33ba18bfc419f77d5bb25318d11e29dbb).
 Thanks!



##########
arrow/ipc/writer.go:
##########
@@ -136,6 +148,11 @@ func NewWriter(w io.Writer, opts ...Option) *Writer {
 }
 
 func (w *Writer) Close() error {
+       if w.err != nil {
+               w.releaseDictionaries()
+               w.pw = nil
+               return w.err

Review Comment:
   Added a regression test and pushed it in 
[75b990e3](https://github.com/fallintoplace/arrow-go/commit/75b990e33ba18bfc419f77d5bb25318d11e29dbb)



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

Reply via email to