Skip to content

Commit

Permalink
feat: try get pk values from cache when applying predicate to parquet (
Browse files Browse the repository at this point in the history
…#3286)

Signed-off-by: Ruihang Xia <[email protected]>
Co-authored-by: tison <[email protected]>
  • Loading branch information
waynexia and tisonkun authored Apr 9, 2024
1 parent 34f935d commit aab7367
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mito2/src/sst/parquet/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,12 @@ impl ParquetReader {
};
let result = match column_metadata.semantic_type {
SemanticType::Tag => {
let pk_values = self.codec.decode(input.primary_key())?;
let pk_values = if let Some(pk_values) = input.pk_values() {
pk_values
} else {
input.set_pk_values(self.codec.decode(input.primary_key())?);
input.pk_values().unwrap()
};
// Safety: this is a primary key
let pk_index = self
.read_format
Expand All @@ -712,7 +717,6 @@ impl ParquetReader {
.evaluate_scalar(&pk_value)
.context(FilterRecordBatchSnafu)?
{
input.set_pk_values(pk_values);
continue;
} else {
// PK not match means the entire batch is filtered out.
Expand Down

0 comments on commit aab7367

Please sign in to comment.