zeroshade commented on code in PR #14146:
URL: https://github.com/apache/arrow/pull/14146#discussion_r978837630


##########
go/arrow/array/concat.go:
##########
@@ -512,6 +518,78 @@ func concat(data []arrow.ArrayData, mem memory.Allocator) 
(arrow.ArrayData, erro
                if err != nil {
                        return nil, err
                }
+       case *arrow.RunLengthEncodedType:
+               physicalLength, overflow := int32(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 := rle.GetPhysicalLength(d)
+                       off := rle.GetPhysicalOffset(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 = addOvf32(physicalLength, 
int32(plen))
+                       if overflow {
+                               return nil, fmt.Errorf("%w: run length encoded 
array length must fit into a 32-bit signed integer",

Review Comment:
   The Go impl uses `int` which will be 32-bit on 32-bit systems and 64-bit on 
64-bit systems.



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