thinkharderdev commented on code in PR #2526:
URL: https://github.com/apache/arrow-rs/pull/2526#discussion_r950334989


##########
parquet/src/arrow/async_reader.rs:
##########
@@ -139,6 +143,80 @@ pub trait AsyncFileReader: Send {
     /// allowing fine-grained control over how metadata is sourced, in 
particular allowing
     /// for caching, pre-fetching, catalog metadata, etc...
     fn get_metadata(&mut self) -> BoxFuture<'_, Result<Arc<ParquetMetaData>>>;
+
+    /// Provides asynchronous access to the the page index for each column 
chunk in a
+    /// row group. Will panic if `row_group_idx` is greater than or equal to 
`num_row_groups`
+    fn get_column_indexes(
+        &mut self,
+        metadata: Arc<ParquetMetaData>,
+        row_group_idx: usize,
+    ) -> BoxFuture<'_, Result<Vec<Index>>> {
+        async move {
+            let chunks = metadata.row_group(row_group_idx).columns();
+
+            let (offset, lengths) = 
index_reader::get_index_offset_and_lengths(chunks)?;
+            let length = lengths.iter().sum::<usize>();
+
+            if length == 0 {
+                return Ok(vec![Index::NONE; chunks.len()]);
+            }
+
+            //read all need data into buffer
+            let data = self
+                .get_bytes(offset as usize..offset as usize + length)

Review Comment:
   Yeah, that makes sense. 



-- 
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]

Reply via email to