EdwardShen125 opened a new issue, #1693:
URL: https://github.com/apache/arrow-go/issues/1693
### Describe the bug, including details regarding any error messages,
version, and platform.
`WriteBatch` returns an error when it recovers a panic, but the error is not
kept on the column, so every `Close` after it returns nil and the file ends up
with a footer for rows that have no values. `FlushCurrentPage` errors are kept
(#1597, #1621), recovered panics are not. This is the case @zeroshade noted in
the #1621 review. On main:
```go
root, _ := schema.NewGroupNode("schema", parquet.Repetitions.Required,
schema.FieldList{
schema.NewInt32Node("col", parquet.Repetitions.Optional, -1),
}, -1)
var buf bytes.Buffer
props := parquet.NewWriterProperties(parquet.WithDictionaryDefault(false))
w := file.NewParquetWriter(&buf, root, file.WithWriterProps(props))
rg := w.AppendRowGroup()
col, _ := rg.NextColumn()
_, err := col.(*file.Int32ColumnChunkWriter).WriteBatch([]int32{1},
[]int16{1, 1, 1}, nil)
fmt.Println(err) // unknown error type: runtime error: slice bounds out of
range [:3] with capacity 1
fmt.Println(col.Close(), rg.Close(), w.Close()) // <nil> <nil> <nil>
r, _ := file.NewParquetReader(bytes.NewReader(buf.Bytes()))
fmt.Println(r.MetaData().NumRows()) // 3; reading the column back gives 0
rows and no error
```
Expected: `Close` returns the saved error and no footer is written, same as
for a `FlushCurrentPage` error.
### Component(s)
Parquet
--
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]