Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "A column is known to be entirely NULL" in PruningPredicate #9223

Merged
5 changes: 5 additions & 0 deletions datafusion-examples/examples/pruning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ impl PruningStatistics for MyCatalog {
None
}

fn row_counts(&self, _column: &Column) -> Option<ArrayRef> {
// In this example, we know nothing about the number of rows in each file
None
}

fn contained(
&self,
_column: &Column,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1870,7 +1870,7 @@ mod tests {

assert_contains!(
&display,
"pruning_predicate=c1_min@0 != bar OR bar != c1_max@1"
"pruning_predicate=CASE WHEN c1_null_count@2 = c1_row_count@3 THEN false ELSE c1_min@0 != bar OR bar != c1_max@1 END"
);

assert_contains!(&display, r#"predicate=c1@0 != bar"#);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@ impl<'a> PruningStatistics for PagesPruningStatistics<'a> {
}
}

fn row_counts(&self, _column: &datafusion_common::Column) -> Option<ArrayRef> {
None
}

fn contained(
&self,
_column: &datafusion_common::Column,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ impl PruningStatistics for BloomFilterStatistics {
None
}

fn row_counts(&self, _column: &Column) -> Option<ArrayRef> {
None
}

/// Use bloom filters to determine if we are sure this column can not
/// possibly contain `values`
///
Expand Down Expand Up @@ -328,6 +332,10 @@ impl<'a> PruningStatistics for RowGroupPruningStatistics<'a> {
scalar.to_array().ok()
}

fn row_counts(&self, _column: &Column) -> Option<ArrayRef> {
None
}

fn contained(
&self,
_column: &Column,
Expand Down
Loading
Loading