Skip to content

Commit

Permalink
chore: avoid get column
Browse files Browse the repository at this point in the history
  • Loading branch information
evenyag committed Aug 28, 2024
1 parent feedcd4 commit e10b732
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mito2/src/sst/parquet/row_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ impl<'a> InMemoryRowGroup<'a> {
continue;
};

let column = self.metadata.column(idx);
if let Some(cache) = &self.cache_manager {
let column = self.metadata.column(idx);
// Put the page to the cache if we don't cache the whole row group.
if !cache_row_group_pages(column) {
let page_key = PageKey::Compressed {
Expand All @@ -218,7 +218,7 @@ impl<'a> InMemoryRowGroup<'a> {
}

*chunk = Some(Arc::new(ColumnChunkData::Dense {
offset: self.metadata.column(idx).byte_range().0 as usize,
offset: column.byte_range().0 as usize,
data,
}));
}
Expand Down Expand Up @@ -260,7 +260,7 @@ impl<'a> InMemoryRowGroup<'a> {

*chunk = cache.get_pages(&page_key).map(|page_value| {
Arc::new(ColumnChunkData::Dense {
offset: self.metadata.column(idx).byte_range().0 as usize,
offset: column.byte_range().0 as usize,
data: page_value.compressed.clone(),
})
});
Expand Down

0 comments on commit e10b732

Please sign in to comment.