zeroshade commented on code in PR #547:
URL: https://github.com/apache/arrow-go/pull/547#discussion_r2733755253
##########
internal/utils/buf_reader.go:
##########
@@ -108,10 +111,48 @@ func (r *byteReader) Reset(Reader) {}
func (r *byteReader) BufferSize() int { return len(r.buf) }
+func (r *byteReader) Buffered() int { return len(r.buf) - r.pos }
+
+func (r *byteReader) Free() {}
Review Comment:
should `Free` do `r.r = nil` and `r.buf = nil` ?
##########
parquet/file/row_group_reader.go:
##########
@@ -134,11 +134,13 @@ func (r *RowGroupReader) GetColumnPageReader(i int)
(PageReader, error) {
}
if r.fileDecryptor == nil {
+ stream.Free()
Review Comment:
should we just put `defer stream.Free()` at line 121 instead?
##########
parquet/reader_properties.go:
##########
@@ -50,8 +50,11 @@ type BufferedReader interface {
Peek(int) ([]byte, error)
Discard(int) (int, error)
Outer() utils.Reader
+ // Buffered returns the number of bytes already read and stored in the
buffer
+ Buffered() int
Review Comment:
this will potentially break other users, we instead need to create a new
interface the embeds this one so that we don't break other consumers. Something
like adding to `internal/utils/buf_reader.go`
```go
type BufferedReaderV2 interface {
BufferedReader
Buffered() int
Free()
}
```
--
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]