zeroshade commented on code in PR #34079:
URL: https://github.com/apache/arrow/pull/34079#discussion_r1100645386
##########
go/arrow/scalar/scalar.go:
##########
@@ -664,6 +671,28 @@ func GetScalar(arr arrow.Array, idx int) (Scalar, error) {
return NewTime64Scalar(arr.Value(idx), arr.DataType()), nil
case *array.Timestamp:
return NewTimestampScalar(arr.Value(idx), arr.DataType()), nil
+ case *array.RunEndEncoded:
+ physicalIndex := encoded.FindPhysicalIndex(arr.Data(),
arr.Offset()+idx)
+ value, err := GetScalar(arr.Values(), physicalIndex)
+ if err != nil {
+ return nil, err
+ }
+
+ var runLength int64
+
+ runEnds := arr.RunEndsArr()
+ switch ends := runEnds.(type) {
+ case *array.Int16:
+ runLength = int64(ends.Value(physicalIndex))
+ case *array.Int32:
+ runLength = int64(ends.Value(physicalIndex))
+ case *array.Int64:
+ runLength = int64(ends.Value(physicalIndex))
+ }
Review Comment:
@felipecrv did you discuss the run-end-encoded scalar with @pitrou or anyone
else? @lidavidm makes a good point that there's the possibility that we don't
actually need a specific RunEndEncoded scalar type.
--
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]