(
&self,
column: &Column,
get_stat: impl Fn(&ColumnStatistics) -> &Precision<ScalarValue>,
)
| 329 | } |
| 330 | |
| 331 | fn get_exact_column_statistics( |
| 332 | &self, |
| 333 | column: &Column, |
| 334 | get_stat: impl Fn(&ColumnStatistics) -> &Precision<ScalarValue>, |
| 335 | ) -> Option<ArrayRef> { |
| 336 | let index = self.schema.index_of(column.name()).ok()?; |
| 337 | let mut has_value = false; |
| 338 | match ScalarValue::iter_to_array(self.statistics.iter().map(|s| { |
| 339 | s.column_statistics |
| 340 | .get(index) |
| 341 | .and_then(|stat| { |
| 342 | if let Precision::Exact(min) = get_stat(stat) { |
| 343 | has_value = true; |
| 344 | Some(min.clone()) |
| 345 | } else { |
| 346 | None |
| 347 | } |
| 348 | }) |
| 349 | .unwrap_or(ScalarValue::Null) |
| 350 | })) { |
| 351 | // If there is any non-null value and no errors, return the array |
| 352 | Ok(array) => has_value.then_some(array), |
| 353 | Err(_) => { |
| 354 | log::warn!( |
| 355 | "Failed to convert min values to array for column {}", |
| 356 | column.name() |
| 357 | ); |
| 358 | None |
| 359 | } |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | impl PruningStatistics for PrunableStatistics { |
no test coverage detected