-
Notifications
You must be signed in to change notification settings - Fork 105
[Go] *array.Binary.ValueOffset doesn't work correctly #41
Copy link
Copy link
Closed
Labels
Type: bugSomething isn't workingSomething isn't working
Description
Describe the bug, including details regarding any error messages, version, and platform.
https://github.com/apache/arrow/blob/main/go/arrow/array/binary.go#L76 -- this place is incorrect. For example, valueOffsets contain 6 offsets for the array with 5 elements, but calling array.ValueOffset(5) will cause the panic although the element exists.
It must be
func (a *Binary) ValueOffset(i int) int {
if i < 0 || i > a.array.data.length {
panic("arrow/array: index out of range")
}
return int(a.valueOffsets[a.array.data.offset+i])
}
similar to strings https://github.com/apache/arrow/blob/main/go/arrow/array/string.go#L66.
Component(s)
Go
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: bugSomething isn't workingSomething isn't working