lidavidm commented on code in PR #34079:
URL: https://github.com/apache/arrow/pull/34079#discussion_r1100674053
##########
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:
Of course, Arrow hasn't really differentiated like that in the past since
effectively everything was a 'physical' value (even if there was sort of not
really a distinction between physical and logical types). But dictionary and
run-end encoding kind of changes that up (the latter more than the former), and
what happens with StringView when we get there?
--
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]