You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/19 09:24:22 UTC

[GitHub] [arrow] amol- commented on a diff in pull request #13155: ARROW-16469: [Python] Table.filter and Dataset.filter

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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org