(
file_groups: Vec<FileGroup>,
table_schema: SchemaRef,
collect_stats: bool,
inexact_stats: bool,
)
| 507 | /// * The summary statistics across all file groups, aka all files summary statistics |
| 508 | #[expect(clippy::needless_pass_by_value)] |
| 509 | pub fn compute_all_files_statistics( |
| 510 | file_groups: Vec<FileGroup>, |
| 511 | table_schema: SchemaRef, |
| 512 | collect_stats: bool, |
| 513 | inexact_stats: bool, |
| 514 | ) -> Result<(Vec<FileGroup>, Statistics)> { |
| 515 | let file_groups_with_stats = file_groups |
| 516 | .into_iter() |
| 517 | .map(|file_group| { |
| 518 | compute_file_group_statistics( |
| 519 | file_group, |
| 520 | Arc::clone(&table_schema), |
| 521 | collect_stats, |
| 522 | ) |
| 523 | }) |
| 524 | .collect::<Result<Vec<_>>>()?; |
| 525 | |
| 526 | // Then summary statistics across all file groups |
| 527 | let file_groups_statistics = file_groups_with_stats |
| 528 | .iter() |
| 529 | .filter_map(|file_group| file_group.file_statistics(None)); |
| 530 | |
| 531 | let mut statistics = Statistics::try_merge_iter_with_ndv_fallback( |
| 532 | file_groups_statistics, |
| 533 | &table_schema, |
| 534 | NdvFallback::Max, |
| 535 | )?; |
| 536 | |
| 537 | if inexact_stats { |
| 538 | statistics = statistics.to_inexact() |
| 539 | } |
| 540 | |
| 541 | Ok((file_groups_with_stats, statistics)) |
| 542 | } |
| 543 | |
| 544 | #[deprecated(since = "47.0.0", note = "Use Statistics::add")] |
| 545 | pub fn add_row_stats( |
searching dependent graphs…