zeroshade commented on code in PR #34450:
URL: https://github.com/apache/arrow/pull/34450#discussion_r1126689841
##########
go/arrow/array/string.go:
##########
@@ -50,8 +50,11 @@ func (a *String) Reset(data arrow.ArrayData) {
// Value returns the slice at index i. This value should not be mutated.
func (a *String) Value(i int) string {
+ sb := strings.Builder{}
+
i = i + a.array.data.offset
- return a.values[a.offsets[i]:a.offsets[i+1]]
+ sb.WriteString(a.values[a.offsets[i]:a.offsets[i+1]])
+ return sb.String()
Review Comment:
Ideally we'd still maintain a method that would let someone retrieve the
slice referencing the data to allow consumers to avoid the copy if desired
(such as the `GetView` in the C++ lib)
--
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]