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

Function verify_sort_integrity

datafusion/datasource/src/mod.rs:593–613  ·  view source on GitHub ↗

Helper function to verify that files within each group maintain sort order Used by tests and benchmarks

(file_groups: &[FileGroup])

Source from the content-addressed store, hash-verified

591// Helper function to verify that files within each group maintain sort order
592/// Used by tests and benchmarks
593pub fn verify_sort_integrity(file_groups: &[FileGroup]) -> bool {
594 for group in file_groups {
595 let files = group.iter().collect::<Vec<_>>();
596 for i in 1..files.len() {
597 let prev_file = files[i - 1];
598 let curr_file = files[i];
599
600 // Check if the min value of current file is greater than max value of previous file
601 if let (Some(prev_stats), Some(curr_stats)) =
602 (&prev_file.statistics, &curr_file.statistics)
603 {
604 let prev_max = &prev_stats.column_statistics[0].max_value;
605 let curr_min = &curr_stats.column_statistics[0].min_value;
606 if curr_min.get_value().unwrap() <= prev_max.get_value().unwrap() {
607 return false;
608 }
609 }
610 }
611 }
612 true
613}
614
615#[cfg(test)]
616mod tests {

Callers

nothing calls this directly

Calls 3

iterMethod · 0.45
lenMethod · 0.45
get_valueMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…