Skip to content

Commit be1435f

Browse files
committed
rebase
1 parent a9550ab commit be1435f

File tree

1 file changed

+27
-1
lines changed
  • parquet/src/arrow/async_reader

1 file changed

+27
-1
lines changed

parquet/src/arrow/async_reader/mod.rs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,33 @@ struct InMemoryRowGroup<'a> {
811811
projection_to_cache: Option<ProjectionMask>,
812812
}
813813

814-
impl InMemoryRowGroup<'_> {
814+
impl<'a> InMemoryRowGroup<'a> {
815+
fn new(
816+
metadata: &'a RowGroupMetaData,
817+
offset_index: Option<&'a [OffsetIndexMetaData]>,
818+
projection_to_cache: Option<ProjectionMask>,
819+
) -> Self {
820+
let to_cache_column_cnt = projection_to_cache
821+
.as_ref()
822+
.map(|p| {
823+
if let Some(mask) = &p.mask {
824+
mask.iter().filter(|&&b| b).count()
825+
} else {
826+
metadata.columns().len()
827+
}
828+
})
829+
.unwrap_or(0);
830+
Self {
831+
metadata,
832+
offset_index,
833+
column_chunks: vec![None; metadata.columns().len()],
834+
row_count: metadata.num_rows() as usize,
835+
cache: Arc::new(PredicatePageCache::new(to_cache_column_cnt)),
836+
projection_to_cache,
837+
}
838+
}
839+
}
840+
impl<'a> InMemoryRowGroup<'a> {
815841
/// Fetches the necessary column data into memory
816842
async fn fetch<T: AsyncFileReader + Send>(
817843
&mut self,

0 commit comments

Comments
 (0)