Skip to content

Commit 5a9dfc3

Browse files
authored
fix: Parquet premature closing (#652)
Co-authored-by: Kemal Hadimli <disq@users.noreply.github.com>
1 parent 0139219 commit 5a9dfc3

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

parquet/write.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (c *Client) WriteHeader(w io.Writer, t *schema.Table) (ftypes.Handle, error
3030
)
3131
arrprops := pqarrow.DefaultWriterProps()
3232
newSchema := convertSchema(t.ToArrowSchema())
33-
fw, err := pqarrow.NewFileWriter(newSchema, w, props, arrprops)
33+
fw, err := pqarrow.NewFileWriter(newSchema, &nopCloseWriter{Writer: w}, props, arrprops)
3434
if err != nil {
3535
return nil, err
3636
}
@@ -159,3 +159,13 @@ func transformToString(arr arrow.Array) arrow.Array {
159159

160160
return builder.NewArray()
161161
}
162+
163+
type nopCloseWriter struct {
164+
io.Writer
165+
}
166+
167+
func (*nopCloseWriter) Close() error {
168+
return nil
169+
}
170+
171+
var _ io.WriteCloser = (*nopCloseWriter)(nil)

0 commit comments

Comments
 (0)