zeroshade commented on code in PR #34631:
URL: https://github.com/apache/arrow/pull/34631#discussion_r1157665778
##########
go/parquet/pqarrow/column_readers.go:
##########
@@ -546,6 +551,14 @@ func transferBinary(rdr file.RecordReader, dt
arrow.DataType) *arrow.Chunked {
defer chunks[idx].Data().Release()
defer chunks[idx].Release()
}
+ } else if dt.ID() == arrow.EXTENSION && len(chunks) > 0 &&
arrow.StorageTypeEqual(chunks[0].DataType(), dt) &&
!arrow.TypeEqual(chunks[0].DataType(), dt) {
+ // convert chunks from the underlying storage type to extension
type without copying data
+ etype := dt.(arrow.ExtensionType)
+
+ for idx := range chunks {
+ chunks[idx] = array.NewExtensionArrayWithStorage(etype,
chunks[idx])
+ defer chunks[idx].Release()
+ }
Review Comment:
probably should be:
```go
for idx, chk := range chunks {
chunks[idx] = array.NewExtensionArrayWithStorage(etype, chk)
chk.Release() // NewExtensionArrayWithStorage will call retain on chk,
so it still needs to be released
defer chunks[idx].Release()
}
```
--
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]