feat: add API for validating a predicate against a chunk:
parent
0a3ca90809
commit
8b458e2c2b
|
@ -210,6 +210,13 @@ impl Chunk {
|
|||
// ---- Schema queries
|
||||
//
|
||||
|
||||
/// Validates if the predicate can be applied to the table based on the
|
||||
/// schema and the predicate's expressions. Returns an error if the
|
||||
/// predicate cannot be applied.
|
||||
pub fn validate_predicate(&self, predicate: Predicate) -> Result<Predicate, Error> {
|
||||
self.table.validate_predicate(predicate).context(TableError)
|
||||
}
|
||||
|
||||
/// Determines if one of more rows in the provided table could possibly
|
||||
/// match the provided predicate.
|
||||
///
|
||||
|
|
|
@ -234,6 +234,14 @@ impl Table {
|
|||
Arc::clone(&self.table_data.read().meta)
|
||||
}
|
||||
|
||||
/// Validates if the predicate can be applied to the table based on the
|
||||
/// schema and the predicate's expressions. Returns an error if the
|
||||
/// predicate cannot be applied.
|
||||
pub fn validate_predicate(&self, predicate: Predicate) -> Result<Predicate, Error> {
|
||||
let table_data = self.table_data.read();
|
||||
Ok(table_data.meta.validate_exprs(predicate)?.into())
|
||||
}
|
||||
|
||||
/// Determines if one of more row groups in the `Table` could possibly
|
||||
/// contain one or more rows that satisfy the provided predicate.
|
||||
pub fn could_pass_predicate(&self, predicate: &Predicate) -> bool {
|
||||
|
|
Loading…
Reference in New Issue