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


##########
parquet/src/arrow/async_reader.rs:
##########
@@ -218,6 +296,36 @@ impl<T: AsyncFileReader + Send + 'static> 
ArrowReaderBuilder<AsyncReader<T>> {
         Self::new_builder(AsyncReader(input), metadata, Default::default())
     }
 
+    pub async fn new_with_index(mut input: T) -> Result<Self> {
+        let metadata = input.get_metadata().await?;
+
+        let mut row_groups = metadata.row_groups().to_vec();
+
+        let mut columns_indexes = vec![];
+        let mut offset_indexes = vec![];
+
+        for (idx, rg) in row_groups.iter_mut().enumerate() {
+            let column_index = input.get_column_indexes(metadata.clone(), 
idx).await?;
+
+            columns_indexes.push(column_index);
+            if let Some(offset_index) =
+                input.get_page_locations(metadata.clone(), idx).await?
+            {
+                rg.set_page_offset(offset_index.clone());
+                offset_indexes.push(offset_index);
+            }
+        }
+
+        let metadata = Arc::new(ParquetMetaData::new_with_page_index(

Review Comment:
   Yeah, I agree. 



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