I have a RecordBatch from a Plasma DataStore which I can read into either a pyarrow.RecordBatch or a pyarrow.Table. I am now trying to filter out rows before converting it to pandas (to_pandas).
Is there a way of using the filter methods from the new Dataset API (that you can use on ParquetDataset) on a pyarrow.Table? This would allow me to us a filter like this:
[[('date', '=', '2020-01-01')]]
Looking at the source code both pyarrow.Table and pyarrow.RecordBatch appears to have a filter function but at least RecordBatch requires a boolean mask.
Is this possible? The reason is that the dataset contains a lot of strings (and/or categories) which are not zero-copy, so running to_pandas actually introduces significant latency and I'm only every looking for about 20% of the dataset.
Regards,
Niklas