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

Method find_stat_column

datafusion/pruning/src/pruning_predicate.rs:777–798  ·  view source on GitHub ↗
(
        &self,
        column: &phys_expr::Column,
        statistics_type: StatisticsType,
    )

Source from the content-addressed store, hash-verified

775 }
776
777 fn find_stat_column(
778 &self,
779 column: &phys_expr::Column,
780 statistics_type: StatisticsType,
781 ) -> Option<usize> {
782 match statistics_type {
783 StatisticsType::RowCount => {
784 // Use the first row count we find, if any
785 self.columns
786 .iter()
787 .enumerate()
788 .find(|(_i, (_c, t, _f))| t == &statistics_type)
789 .map(|(i, (_c, _t, _f))| i)
790 }
791 _ => self
792 .columns
793 .iter()
794 .enumerate()
795 .find(|(_i, (c, t, _f))| c == column && t == &statistics_type)
796 .map(|(i, (_c, _t, _f))| i),
797 }
798 }
799
800 /// Rewrites column_expr so that all appearances of column
801 /// are replaced with a reference to either the min or max

Callers 1

stat_column_exprMethod · 0.80

Calls 2

mapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected