Skip to content

Commit 05e6a54

Browse files
committed
feat: add BoundPredicateEvaluator
1 parent 301a0af commit 05e6a54

File tree

4 files changed

+392
-4
lines changed

4 files changed

+392
-4
lines changed

crates/iceberg/src/expr/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
//! This module contains expressions.
1919
2020
mod term;
21-
22-
use std::fmt::{Display, Formatter};
23-
2421
pub use term::*;
2522
mod predicate;
23+
pub(crate) mod visitors;
24+
pub use predicate::*;
2625

2726
use crate::spec::SchemaRef;
28-
pub use predicate::*;
27+
use std::fmt::{Display, Formatter};
2928

3029
/// Predicate operators used in expressions.
3130
///

crates/iceberg/src/expr/predicate.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ impl<T> UnaryExpression<T> {
116116
debug_assert!(op.is_unary());
117117
Self { op, term }
118118
}
119+
120+
pub(crate) fn term(&self) -> &T {
121+
&self.term
122+
}
123+
124+
pub(crate) fn op(&self) -> &PredicateOperator {
125+
&self.op
126+
}
119127
}
120128

121129
/// Binary predicate, for example, `a > 10`.
@@ -144,6 +152,18 @@ impl<T> BinaryExpression<T> {
144152
debug_assert!(op.is_binary());
145153
Self { op, term, literal }
146154
}
155+
156+
pub(crate) fn term(&self) -> &T {
157+
&self.term
158+
}
159+
160+
pub(crate) fn op(&self) -> &PredicateOperator {
161+
&self.op
162+
}
163+
164+
pub(crate) fn literal(&self) -> &Datum {
165+
&self.literal
166+
}
147167
}
148168

149169
impl<T: Display> Display for BinaryExpression<T> {
@@ -191,6 +211,18 @@ impl<T> SetExpression<T> {
191211
debug_assert!(op.is_set());
192212
Self { op, term, literals }
193213
}
214+
215+
pub(crate) fn term(&self) -> &T {
216+
&self.term
217+
}
218+
219+
pub(crate) fn op(&self) -> &PredicateOperator {
220+
&self.op
221+
}
222+
223+
pub(crate) fn literals(&self) -> &FnvHashSet<Datum> {
224+
&self.literals
225+
}
194226
}
195227

196228
impl<T: Bind> Bind for SetExpression<T> {

0 commit comments

Comments
 (0)