emkornfield commented on a change in pull request #9862:
URL: https://github.com/apache/arrow/pull/9862#discussion_r606822784



##########
File path: go/arrow/ipc/file_reader.go
##########
@@ -348,10 +356,26 @@ func (src *ipcSource) buffer(i int) *memory.Buffer {
                return memory.NewBufferBytes(nil)
        }
 
-       raw := make([]byte, buf.Length())
-       _, err := src.r.ReadAt(raw, buf.Offset())
-       if err != nil {
-               panic(err)
+       var raw []byte
+       if src.codec == nil {
+               raw = make([]byte, buf.Length())
+               _, err := src.r.ReadAt(raw, buf.Offset())
+               if err != nil {
+                       panic(err)
+               }
+       } else {
+               sr := io.NewSectionReader(src.r, buf.Offset(), buf.Length())
+               var uncompressedSize uint64
+               if err := binary.Read(sr, binary.LittleEndian, 
&uncompressedSize); err != nil {

Review comment:
       I think this needs to check for the magic uncompressed value as well and 
revert back to a slice? Are zero length buffers handled upstream from this code?




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to