Skip to content

Commit

Permalink
fix: page index evaluator min/max args inverted (apache#648)
Browse files Browse the repository at this point in the history
* fix: page index evaluator min/max args inverted

* style: fix clippy lint in test
  • Loading branch information
sdd authored Sep 30, 2024
1 parent a6a3fd7 commit af9609d
Show file tree
Hide file tree
Showing 3 changed files with 221 additions and 27 deletions.
16 changes: 8 additions & 8 deletions crates/iceberg/src/expr/visitors/page_index_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ impl<'a> PageIndexEvaluator<'a> {
.zip(row_counts.iter())
.map(|(item, &row_count)| {
predicate(
item.max.map(|val| {
item.min.map(|val| {
Datum::new(field_type.clone(), PrimitiveLiteral::Boolean(val))
}),
item.min.map(|val| {
item.max.map(|val| {
Datum::new(field_type.clone(), PrimitiveLiteral::Boolean(val))
}),
PageNullCount::from_row_and_null_counts(row_count, item.null_count),
Expand All @@ -262,10 +262,10 @@ impl<'a> PageIndexEvaluator<'a> {
.zip(row_counts.iter())
.map(|(item, &row_count)| {
predicate(
item.max
.map(|val| Datum::new(field_type.clone(), PrimitiveLiteral::Int(val))),
item.min
.map(|val| Datum::new(field_type.clone(), PrimitiveLiteral::Int(val))),
item.max
.map(|val| Datum::new(field_type.clone(), PrimitiveLiteral::Int(val))),
PageNullCount::from_row_and_null_counts(row_count, item.null_count),
)
})
Expand All @@ -276,10 +276,10 @@ impl<'a> PageIndexEvaluator<'a> {
.zip(row_counts.iter())
.map(|(item, &row_count)| {
predicate(
item.max
.map(|val| Datum::new(field_type.clone(), PrimitiveLiteral::Long(val))),
item.min
.map(|val| Datum::new(field_type.clone(), PrimitiveLiteral::Long(val))),
item.max
.map(|val| Datum::new(field_type.clone(), PrimitiveLiteral::Long(val))),
PageNullCount::from_row_and_null_counts(row_count, item.null_count),
)
})
Expand Down Expand Up @@ -312,13 +312,13 @@ impl<'a> PageIndexEvaluator<'a> {
.zip(row_counts.iter())
.map(|(item, &row_count)| {
predicate(
item.max.map(|val| {
item.min.map(|val| {
Datum::new(
field_type.clone(),
PrimitiveLiteral::Double(OrderedFloat::from(val)),
)
}),
item.min.map(|val| {
item.max.map(|val| {
Datum::new(
field_type.clone(),
PrimitiveLiteral::Double(OrderedFloat::from(val)),
Expand Down
Loading

0 comments on commit af9609d

Please sign in to comment.