lquerel opened a new issue, #14883:
URL: https://github.com/apache/arrow/issues/14883

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   All my unit tests work with the CheckedAllocator (the one used in the Arrow 
Go library) but when I added the zstd compression option to the IPC writer my 
tests turned red.
   
   The issue is located in the file arrow.ipc.writer line 345 (v10.0.1). 
   
   ```go
        compress := func(idx int, codec compressor) error {
                if p.body[idx] == nil || p.body[idx].Len() == 0 {
                        return nil
                }
                var buf bytes.Buffer
                buf.Grow(codec.MaxCompressedLen(p.body[idx].Len()) + 
arrow.Int64SizeBytes)
                if err := binary.Write(&buf, binary.LittleEndian, 
uint64(p.body[idx].Len())); err != nil {
                        return err
                }
                codec.Reset(&buf)
                if _, err := codec.Write(p.body[idx].Bytes()); err != nil {
                        return err
                }
                if err := codec.Close(); err != nil {
                        return err
                }
                p.body[idx] = memory.NewBufferBytes(buf.Bytes()).   <-- line 345
                return nil
        }
   ```
   
   The previous buffer is replaced by a new one but without:
   - releasing the previous one,
   - and specifying the current allocator to the new buffer.
   
   
   
   ### Component(s)
   
   Go


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