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



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

Review comment:
       the choice to use panic is probably to make the consumable api easier to 
manage instead of having to propagate and push errors everywhere it just fails 
hard. Since the existing code was already using panic, that's what I maintained 
in my changes rather than adding error out params.




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