feat: try get pk values from cache when applying predicate to parquet (#3286)

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Co-authored-by: tison <wander4096@gmail.com>
This commit is contained in:
Ruihang Xia
2024-04-09 21:53:38 +09:00
committed by GitHub
parent 34f935df66
commit aab7367804

View File

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