Commits


Weston Pace authored and David Li committed 16af17c3327
ARROW-14356: [C++] Create kernel to determine buffer memory "referenced" by arrays (even if there are offsets) This creates a `byte_ranges` vector function which extracts the buffer ranges referenced by an array. It's a bit involved because array offsets are in "# of values" and that does not always translate cleanly into an offset into the underlying buffers. The trickiest case is dense unions where we need to traverse the values buffer to figure out the correct array offset for the child arrays. The one case not handled by this PR is dictionary arrays. A sliced array may only reference a portion of the dictionary but since that referenced portion need not even be contiguous it would be too expensive to figure out. Pruning of duplicate ranges will be handled in ARROW-14357 Once this is in I plan to wrap it with another utility function to sum up the range lengths (the only reason I'm returning ranges is so that I can later prune duplicate ranges). This function will be complementary to (i.e. will not replace) the naive function TotalBufferSize added in #11441 . The two functions will provide two possible ways of measuring the size of an element. Closes #11542 from westonpace/feature/ARROW-14356--buffer-size-bytes-kernel Authored-by: Weston Pace <weston.pace@gmail.com> Signed-off-by: David Li <li.davidm96@gmail.com>