amol- commented on code in PR #13155:
URL: https://github.com/apache/arrow/pull/13155#discussion_r876827822
##########
python/pyarrow/_dataset.pyx:
##########
@@ -405,6 +405,27 @@ cdef class Dataset(_Weakrefable):
use_threads=use_threads,
coalesce_keys=coalesce_keys,
output_type=InMemoryDataset)
+ def filter(self, expr):
+ """
+ Select rows from the Dataset.
+
+ The Dataset can be filtered based on a boolean :class:`Expression`
filter.
+
+ Parameters
+ ----------
+ expr : Expression
+ The boolean :class:`Expression` to filter the table with.
+
+ Returns
+ -------
+ filtered : InMemoryDataset
+ An InMemoryDataset of the same schema, with only the rows selected
+ by applied filtering
+
+ """
+ return _pc()._exec_plan._filter_table(self, expr,
Review Comment:
Good catch, I was thinking toward chaining of `join`,`group_by`,`filter` and
thus had `InMemoryDataset` in mind as the input, but you are right, if the
input is a on-disk dataset, using a scanner would be much more effective.
--
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]