Skip to content

Commit

Permalink
Implement contains API in PruningPredicate
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Dec 6, 2023
1 parent e1df3fe commit 7c29979
Show file tree
Hide file tree
Showing 3 changed files with 751 additions and 236 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use arrow::array::{
};
use arrow::datatypes::DataType;
use arrow::{array::ArrayRef, datatypes::SchemaRef, error::ArrowError};
use datafusion_common::{DataFusionError, Result};
use datafusion_common::{DataFusionError, Result, ScalarValue};
use datafusion_physical_expr::expressions::Column;
use datafusion_physical_expr::{split_conjunction, PhysicalExpr};
use log::{debug, trace};
Expand All @@ -37,6 +37,7 @@ use parquet::{
},
format::PageLocation,
};
use std::collections::HashSet;
use std::sync::Arc;

use crate::datasource::physical_plan::parquet::parquet_to_arrow_decimal_type;
Expand Down Expand Up @@ -554,4 +555,12 @@ impl<'a> PruningStatistics for PagesPruningStatistics<'a> {
))),
}
}

fn contains(
&self,
_column: &datafusion_common::Column,
_values: &HashSet<ScalarValue>,
) -> Option<BooleanArray> {
None
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// under the License.

use arrow::{array::ArrayRef, datatypes::Schema};
use arrow_array::BooleanArray;
use arrow_schema::FieldRef;
use datafusion_common::tree_node::{TreeNode, VisitRecursion};
use datafusion_common::{Column, DataFusionError, Result, ScalarValue};
Expand Down Expand Up @@ -339,6 +340,14 @@ impl<'a> PruningStatistics for RowGroupPruningStatistics<'a> {
let scalar = ScalarValue::UInt64(Some(c.statistics()?.null_count()));
scalar.to_array().ok()
}

fn contains(
&self,
_column: &Column,
_values: &HashSet<ScalarValue>,
) -> Option<BooleanArray> {
None
}
}

#[cfg(test)]
Expand Down
Loading

0 comments on commit 7c29979

Please sign in to comment.