thinkharderdev opened a new issue, #2270:
URL: https://github.com/apache/arrow-rs/issues/2270

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   <!--
   A clear and concise description of what the problem is. Ex. I'm always 
frustrated when [...] 
   (This section helps Arrow developers understand the context and *why* for 
this feature, in addition to  the *what*)
   -->
   
   The current (non-public) API for skipping records has some shortcomings when 
trying to implement predicate pushdown from DataFusion. It assumes that we have 
the entire `VecDequeue<RowSelection>` for an entire row group when construction 
the `ParquetRecordBatchReader` which makes doing streaming filtering a 
challenge. 
   
   **Describe the solution you'd like**
   <!--
   A clear and concise description of what you want to happen.
   -->
   
   I wrote a prototype of row-level filtering in DataFusion that required a few 
changes to the API here. Two main things:
   
   1. Add a method to `ParquetRecordBatchStream`
   
   ```
   pub fn next_selection(
           &mut self,
           selection: &mut VecDeque<RowSelection>,
       ) -> Option<ArrowResult<RecordBatch>>
   ```
   
   which mimics `poll_next` but applies a selection to the next batch.
   
   2. Add a method to `ParquetRecordBatchReader`
   
   ```
   pub fn next_selection(
           &mut self,
           selection: &mut VecDeque<RowSelection>,
       ) -> Option<ArrowResult<RecordBatch>>
   ```   
   which mimics `next` but applies a selection and, importantly, emits a single 
batch containing all selected rows in `selection`. The current implementation 
just emits the next `RowSelection` that selects and stops. 
   
   See 
https://github.com/coralogix/arrow-datafusion/blob/row-filtering/datafusion/core/src/physical_plan/file_format/parquet.rs
 for the (very hacky) protoype in DataFusion built on 
https://github.com/coralogix/arrow-rs/tree/row-filtering.
   
   **Describe alternatives you've considered**
   <!--
   A clear and concise description of any alternative solutions or features 
you've considered.
   -->
   
   
   **Additional context**
   <!--
   Add any other context or screenshots about the feature request here.
   -->
   


-- 
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-unsubscr...@arrow.apache.org.apache.org

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

Reply via email to