sdd commented on code in PR #558:
URL: https://github.com/apache/iceberg-rust/pull/558#discussion_r1731265175


##########
crates/iceberg/src/expr/visitors/row_group_metrics_evaluator.rs:
##########
@@ -140,21 +140,79 @@ impl<'a> RowGroupMetricsEvaluator<'a> {
             return Ok(None);
         };
 
-        Ok(Some(Datum::try_from_bytes(
-            stats.min_bytes(),
-            primitive_type,
-        )?))
+        if !stats.has_min_max_set() {
+            return Ok(None);
+        }
+
+        Ok(Some(match (primitive_type, stats) {
+            (PrimitiveType::Boolean, Statistics::Boolean(stats)) => 
Datum::bool(*stats.min()),

Review Comment:
   Thanks - I thought this logic might exist elsewhere already but I couldn't 
find it. I'll refactor for reuse. 



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to