M-Tesla commented on code in PR #3144:
URL: https://github.com/apache/iceberg-rust/pull/3144#discussion_r4394691667
##########
crates/iceberg/src/expr/visitors/row_group_metrics_evaluator.rs:
##########
@@ -497,32 +497,17 @@ impl BoundPredicateVisitor for
RowGroupMetricsEvaluator<'_> {
return ROW_GROUP_MIGHT_MATCH;
}
- let Some((stats, primitive_type)) =
self.stats_and_type_for_field_id(field_id)? else {
- return ROW_GROUP_MIGHT_MATCH;
- };
-
- if let Some(lower_bound) =
get_parquet_stat_min_as_datum(&primitive_type, stats)? {
- if lower_bound.is_nan() {
- // NaN indicates unreliable bounds. See the
InclusiveMetricsEvaluator docs for more.
- return ROW_GROUP_MIGHT_MATCH;
- }
-
- if !literals.iter().any(|datum| datum.ge(&lower_bound)) {
- // if all values are less than lower bound, rows cannot match.
- return ROW_GROUP_CANT_MATCH;
- }
- }
-
- if let Some(upper_bound) =
get_parquet_stat_max_as_datum(&primitive_type, stats)? {
- if upper_bound.is_nan() {
- // NaN indicates unreliable bounds. See the
InclusiveMetricsEvaluator docs for more.
- return ROW_GROUP_MIGHT_MATCH;
- }
-
- if !literals.iter().any(|datum| datum.le(&upper_bound)) {
- // if all values are greater than upper bound, rows cannot
match.
- return ROW_GROUP_CANT_MATCH;
- }
+ let lower_bound = self.min_value(field_id)?;
+ let upper_bound = self.max_value(field_id)?;
Review Comment:
Thanks. In now uses one stats_and_type_for_field_id lookup, then the same
min and max helpers. The NaN bound handling is unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]