Ted-Jiang commented on code in PR #1977:
URL: https://github.com/apache/arrow-rs/pull/1977#discussion_r910977280


##########
parquet/src/arrow/array_reader/builder.rs:
##########
@@ -39,33 +39,46 @@ use crate::data_type::{
     Int96Type,
 };
 use crate::errors::Result;
+use crate::file::filer_offset_index::FilterOffsetIndex;
 use crate::schema::types::{ColumnDescriptor, ColumnPath, SchemaDescPtr, Type};
 
 /// Create array reader from parquet schema, projection mask, and parquet file 
reader.
+/// 'row_groups_filter_offset_index' is optional for reducing useless IO
+/// by filtering needless page.
 pub fn build_array_reader(
     parquet_schema: SchemaDescPtr,
     arrow_schema: SchemaRef,
     mask: ProjectionMask,
     row_groups: Box<dyn RowGroupCollection>,
+    row_groups_filter_offset_index: Option<Vec<Vec<FilterOffsetIndex>>>,
 ) -> Result<Box<dyn ArrayReader>> {
     let field =
         convert_schema(parquet_schema.as_ref(), mask, 
Some(arrow_schema.as_ref()))?;
 
     match &field {
-        Some(field) => build_reader(field, row_groups.as_ref()),
+        Some(field) => build_reader(
+            field,
+            row_groups.as_ref(),
+            row_groups_filter_offset_index.as_ref(),
+        ),
         None => Ok(make_empty_array_reader(row_groups.num_rows())),
     }
 }
 
 fn build_reader(
     field: &ParquetField,
     row_groups: &dyn RowGroupCollection,
+    row_groups_filter_offset_index: Option<&Vec<Vec<FilterOffsetIndex>>>,
 ) -> Result<Box<dyn ArrayReader>> {
     match field.field_type {
-        ParquetFieldType::Primitive { .. } => build_primitive_reader(field, 
row_groups),
+        ParquetFieldType::Primitive { .. } => {
+            build_primitive_reader(field, row_groups, 
row_groups_filter_offset_index)

Review Comment:
   For now just support primitive_reader



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