zeroshade commented on code in PR #485:
URL: https://github.com/apache/arrow-go/pull/485#discussion_r2310525023


##########
parquet/internal/encoding/typed_encoder.go:
##########
@@ -556,6 +572,36 @@ func (enc *DictByteArrayEncoder) Type() parquet.Type {
        return parquet.Types.ByteArray
 }
 
+// ByteArrayDecoderWrapper is a wrapper around a ByteArrayDecoder that ensures
+// that the decoded byte arrays are copied into a new, contiguous buffer.
+type ByteArrayDecoderWrapper struct {
+       ByteArrayDecoder
+}
+
+func (d *ByteArrayDecoderWrapper) Decode(out []parquet.ByteArray) (int, error) 
{
+       n, err := d.ByteArrayDecoder.Decode(out)
+       if err != nil {
+               return n, err
+       }
+       cloneByteArray(out[:n])
+       return n, nil

Review Comment:
   it would be better for the cloning to be done by the ByteArrayDecoder itself 
inside of the `Decode` method rather than needing this wrapper.



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