Skip to content

Commit 51bcadb

Browse files
authored
Better document parquet pushdown (apache#5491)
1 parent aad42b5 commit 51bcadb

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

parquet/src/arrow/arrow_reader/filter.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ where
9696
/// leaves 99% of the rows, it may be better to not filter the data from parquet and
9797
/// apply the filter after the RecordBatch has been fully decoded.
9898
///
99+
/// Additionally, even if a predicate eliminates a moderate number of rows, it may still be faster
100+
/// to filter the data after the RecordBatch has been fully decoded, if the eliminated rows are
101+
/// not contiguous.
102+
///
99103
/// [`RowSelection`]: crate::arrow::arrow_reader::RowSelection
100104
pub struct RowFilter {
101105
/// A list of [`ArrowPredicate`]

parquet/src/arrow/arrow_reader/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ impl<T> ArrowReaderBuilder<T> {
141141
/// An example use case of this would be applying a selection determined by
142142
/// evaluating predicates against the [`Index`]
143143
///
144+
/// It is recommended to enable reading the page index if using this functionality, to allow
145+
/// more efficient skipping over data pages. See [`ArrowReaderOptions::with_page_index`]
146+
///
144147
/// [`Index`]: crate::file::page_index::index::Index
145148
pub fn with_row_selection(self, selection: RowSelection) -> Self {
146149
Self {
@@ -152,6 +155,9 @@ impl<T> ArrowReaderBuilder<T> {
152155
/// Provide a [`RowFilter`] to skip decoding rows
153156
///
154157
/// Row filters are applied after row group selection and row selection
158+
///
159+
/// It is recommended to enable reading the page index if using this functionality, to allow
160+
/// more efficient skipping over data pages. See [`ArrowReaderOptions::with_page_index`].
155161
pub fn with_row_filter(self, filter: RowFilter) -> Self {
156162
Self {
157163
filter: Some(filter),
@@ -163,6 +169,9 @@ impl<T> ArrowReaderBuilder<T> {
163169
///
164170
/// The limit will be applied after any [`Self::with_row_selection`] and [`Self::with_row_filter`]
165171
/// allowing it to limit the final set of rows decoded after any pushed down predicates
172+
///
173+
/// It is recommended to enable reading the page index if using this functionality, to allow
174+
/// more efficient skipping over data pages. See [`ArrowReaderOptions::with_page_index`]
166175
pub fn with_limit(self, limit: usize) -> Self {
167176
Self {
168177
limit: Some(limit),
@@ -174,6 +183,9 @@ impl<T> ArrowReaderBuilder<T> {
174183
///
175184
/// The offset will be applied after any [`Self::with_row_selection`] and [`Self::with_row_filter`]
176185
/// allowing it to skip rows after any pushed down predicates
186+
///
187+
/// It is recommended to enable reading the page index if using this functionality, to allow
188+
/// more efficient skipping over data pages. See [`ArrowReaderOptions::with_page_index`]
177189
pub fn with_offset(self, offset: usize) -> Self {
178190
Self {
179191
offset: Some(offset),

0 commit comments

Comments
 (0)