zeroshade commented on code in PR #14223:
URL: https://github.com/apache/arrow/pull/14223#discussion_r1097754389
##########
go/arrow/array/encoded.go:
##########
@@ -68,6 +70,102 @@ func (r *RunEndEncoded) Release() {
r.ends.Release()
}
+// LogicalValuesArray returns an array holding the values of each
+// run, only over the range of run values inside the logical offset/length
+// range of the parent array.
+//
+// Example
+//
+// For this array:
+// RunEndEncoded: { Offset: 150, Length: 1500 }
+// RunEnds: [ 1, 2, 4, 6, 10, 1000, 1750, 2000 ]
+// Values: [ "a", "b", "c", "d", "e", "f", "g", "h" ]
+//
+// LogicalValuesArray will return the following array:
Review Comment:
This function is used for producing the slice that is used for writing the
IPC data. It's a zero-copy slice.
In `encoded.go` there's `MergedRuns` which provides a similar function to
your iterator class which provides zero-copy iteration of runs using
offset/length (and for finding common runs between two REE arrays). The only a
time a copy happens is when calling `LogicalRunEndsArray` when the offset is
non-zero because it needs to modify the actual run-end values to be
zero-adjusted.
--
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]