zero-copy Take?

2023-03-28 Thread John Muehlhausen
Is there a way to pass a RecordBatch (or a batch wrapped as a Table) to Take and get back a Table composed of in-place (zero copy) slices of the input? I suppose this is not too hard to code, just wondered if there is already a utility. Result Take(const Datum& values, const Datum& indices,

Re: zero-copy Take?

2023-03-28 Thread Will Jones
Hi John, Arrays have a `Slice()` method that allows getting a zero-copy slices of the array given an offset and a length. If you had a set of ranges it wouldn't be too hard to write a function that creates a new chunked array made up of these slices. Of course, there are likely cases where the ov

Re: zero-copy Take?

2023-03-28 Thread John Muehlhausen
Thanks for the input. This is motivated by use-cases where suboptimal compute is Ok in order to preserve a lower memory profile. I wanted to be sure I wasn't overlooking a utility before I write my own. -John On Tue, Mar 28, 2023 at 12:27 PM Will Jones wrote: > Hi John, > > Arrays have a `Sli