Skip to content

Commit

Permalink
fix: dont make predicate op pub(crate)"
Browse files Browse the repository at this point in the history
  • Loading branch information
sdd committed Mar 22, 2024
1 parent 380f4a0 commit 47270d2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
18 changes: 15 additions & 3 deletions crates/iceberg/src/expr/predicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ where
#[derive(PartialEq)]
pub struct UnaryExpression<T> {
/// Operator of this predicate, must be single operand operator.
pub(crate) op: PredicateOperator,
op: PredicateOperator,
/// Term of this predicate, for example, `a` in `a IS NULL`.
term: T,
}
Expand Down Expand Up @@ -120,6 +120,10 @@ impl<T> UnaryExpression<T> {
pub(crate) fn term(&self) -> &T {
&self.term
}

pub(crate) fn op(&self) -> &PredicateOperator {
&self.op
}
}

impl UnaryExpression<BoundReference> {
Expand All @@ -133,7 +137,7 @@ impl UnaryExpression<BoundReference> {
#[derive(PartialEq)]
pub struct BinaryExpression<T> {
/// Operator of this predicate, must be binary operator, such as `=`, `>`, `<`, etc.
pub(crate) op: PredicateOperator,
op: PredicateOperator,
/// Term of this predicate, for example, `a` in `a > 10`.
term: T,
/// Literal of this predicate, for example, `10` in `a > 10`.
Expand All @@ -159,6 +163,10 @@ impl<T> BinaryExpression<T> {
pub(crate) fn term(&self) -> &T {
&self.term
}

pub(crate) fn op(&self) -> &PredicateOperator {
&self.op
}
}

impl BinaryExpression<BoundReference> {
Expand Down Expand Up @@ -191,7 +199,7 @@ impl<T: Bind> Bind for BinaryExpression<T> {
#[derive(PartialEq)]
pub struct SetExpression<T> {
/// Operator of this predicate, must be set operator, such as `IN`, `NOT IN`, etc.
pub(crate) op: PredicateOperator,
op: PredicateOperator,
/// Term of this predicate, for example, `a` in `a in (1, 2, 3)`.
term: T,
/// Literals of this predicate, for example, `(1, 2, 3)` in `a in (1, 2, 3)`.
Expand All @@ -217,6 +225,10 @@ impl<T> SetExpression<T> {
pub(crate) fn term(&self) -> &T {
&self.term
}

pub(crate) fn op(&self) -> &PredicateOperator {
&self.op
}
}

impl SetExpression<BoundReference> {
Expand Down
6 changes: 3 additions & 3 deletions crates/iceberg/src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ impl ManifestEvalVisitor {
let pos = expr.term().accessor().position();
let field = &partitions[pos];

match expr.op {
match expr.op() {
PredicateOperator::IsNull => field.contains_null,
PredicateOperator::NotNull => {
todo!()
Expand All @@ -396,7 +396,7 @@ impl ManifestEvalVisitor {
let pos = expr.term().accessor().position();
let _field = &partitions[pos];

match expr.op {
match expr.op() {
PredicateOperator::LessThan => {
todo!()
}
Expand Down Expand Up @@ -430,7 +430,7 @@ impl ManifestEvalVisitor {
let pos = expr.term().accessor().position();
let _field = &partitions[pos];

match expr.op {
match expr.op() {
PredicateOperator::In => {
todo!()
}
Expand Down

0 comments on commit 47270d2

Please sign in to comment.