Skip to content

Commit

Permalink
Refactor: Extract partition_filters from ManifestEvaluator (apach…
Browse files Browse the repository at this point in the history
…e#360)

* refactor: extract inclusive_projection from manifest_evaluator

* refactor: add FileScanStreamContext

* refactor: create partition_spec and partition_schema

* refactor: add cache structs

* refactor: use entry in partition_file_cache

* refactor: use result

* chore: update docs + fmt

* refactor: add bound_filter to FileScanStreamContext

* refactor: return ref BoundPredicate

* fix: return type PartitionSpecRef

* refactor: remove spec_id runtime check

* feat: add check for content_type data
  • Loading branch information
marvinlanhenke authored Apr 30, 2024
1 parent 0154829 commit 7dfc548
Show file tree
Hide file tree
Showing 3 changed files with 371 additions and 261 deletions.
10 changes: 5 additions & 5 deletions crates/iceberg/src/expr/predicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::spec::{Datum, SchemaRef};
use crate::{Error, ErrorKind};

/// Logical expression, such as `AND`, `OR`, `NOT`.
#[derive(PartialEq)]
#[derive(PartialEq, Clone)]
pub struct LogicalExpression<T, const N: usize> {
inputs: [Box<T>; N],
}
Expand Down Expand Up @@ -79,7 +79,7 @@ where
}

/// Unary predicate, for example, `a IS NULL`.
#[derive(PartialEq)]
#[derive(PartialEq, Clone)]
pub struct UnaryExpression<T> {
/// Operator of this predicate, must be single operand operator.
op: PredicateOperator,
Expand Down Expand Up @@ -126,7 +126,7 @@ impl<T> UnaryExpression<T> {
}

/// Binary predicate, for example, `a > 10`.
#[derive(PartialEq)]
#[derive(PartialEq, Clone)]
pub struct BinaryExpression<T> {
/// Operator of this predicate, must be binary operator, such as `=`, `>`, `<`, etc.
op: PredicateOperator,
Expand Down Expand Up @@ -184,7 +184,7 @@ impl<T: Bind> Bind for BinaryExpression<T> {
}

/// Set predicates, for example, `a in (1, 2, 3)`.
#[derive(PartialEq)]
#[derive(PartialEq, Clone)]
pub struct SetExpression<T> {
/// Operator of this predicate, must be set operator, such as `IN`, `NOT IN`, etc.
op: PredicateOperator,
Expand Down Expand Up @@ -613,7 +613,7 @@ impl Not for Predicate {
}

/// Bound predicate expression after binding to a schema.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub enum BoundPredicate {
/// An expression always evaluates to true.
AlwaysTrue,
Expand Down
Loading

0 comments on commit 7dfc548

Please sign in to comment.