MCPcopy Create free account
hub / github.com/apache/datafusion / compute_file_group_statistics

Function compute_file_group_statistics

datafusion/datasource/src/statistics.rs:469–489  ·  view source on GitHub ↗
(
    file_group: FileGroup,
    file_schema: SchemaRef,
    collect_stats: bool,
)

Source from the content-addressed store, hash-verified

467/// A new file group with summary statistics attached
468#[expect(clippy::needless_pass_by_value)]
469pub fn compute_file_group_statistics(
470 file_group: FileGroup,
471 file_schema: SchemaRef,
472 collect_stats: bool,
473) -> Result<FileGroup> {
474 if !collect_stats {
475 return Ok(file_group);
476 }
477
478 let file_group_stats = file_group.iter().filter_map(|file| {
479 let stats = file.statistics.as_ref()?;
480 Some(stats.as_ref())
481 });
482 let statistics = Statistics::try_merge_iter_with_ndv_fallback(
483 file_group_stats,
484 &file_schema,
485 NdvFallback::Max,
486 )?;
487
488 Ok(file_group.with_statistics(Arc::new(statistics)))
489}
490
491/// Computes statistics for all files across multiple file groups.
492///

Calls 4

newFunction · 0.85
iterMethod · 0.45
as_refMethod · 0.45
with_statisticsMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…