lidavidm commented on code in PR #14126:
URL: https://github.com/apache/arrow/pull/14126#discussion_r1087064253


##########
go/arrow/array/concat.go:
##########
@@ -517,6 +523,50 @@ func concat(data []arrow.ArrayData, mem memory.Allocator) 
(arrow.ArrayData, erro
                if err != nil {
                        return nil, err
                }
+       case *arrow.RunEndEncodedType:
+               physicalLength, overflow := int(0), false
+               // we can't use gatherChildren because the Offset and Len of
+               // data doesn't correspond to the physical length or offset
+               runs := make([]arrow.ArrayData, len(data))
+               values := make([]arrow.ArrayData, len(data))
+               for i, d := range data {
+                       plen := encoded.GetPhysicalLength(d)
+                       off := encoded.FindPhysicalOffset(d)
+
+                       runs[i] = NewSliceData(d.Children()[0], int64(off), 
int64(off+plen))
+                       defer runs[i].Release()
+                       values[i] = NewSliceData(d.Children()[1], int64(off), 
int64(off+plen))
+                       defer values[i].Release()
+
+                       physicalLength, overflow = addOvf(physicalLength, 
int(plen))
+                       if overflow {
+                               return nil, fmt.Errorf("%w: run length encoded 
array length must fit into a 32-bit signed integer",

Review Comment:
   Fair enough. I suppose you could short circuit here earlier for int16, but 
as long as it properly fails either way.



-- 
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: github-unsubscr...@arrow.apache.org

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

Reply via email to