Skip to content

Commit fea7f1d

Browse files
Make SetExpression's constructor public (#1695)
## Which issue does this PR close? - Closes #1696 ## What changes are included in this PR? Makes `new` method for SetExpression public. ## Are these changes tested? Functionality is covered by existing tests.
1 parent 1d1b54d commit fea7f1d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

crates/iceberg/src/expr/predicate.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,22 @@ impl<T: Debug> Debug for SetExpression<T> {
259259
}
260260

261261
impl<T> SetExpression<T> {
262-
pub(crate) fn new(op: PredicateOperator, term: T, literals: FnvHashSet<Datum>) -> Self {
262+
/// Creates a set expression with the given operator, term and literal.
263+
///
264+
/// # Example
265+
///
266+
/// ```rust
267+
/// use fnv::FnvHashSet;
268+
/// use iceberg::expr::{PredicateOperator, Reference, SetExpression};
269+
/// use iceberg::spec::Datum;
270+
///
271+
/// SetExpression::new(
272+
/// PredicateOperator::In,
273+
/// Reference::new("a"),
274+
/// FnvHashSet::from_iter(vec![Datum::int(1)]),
275+
/// );
276+
/// ```
277+
pub fn new(op: PredicateOperator, term: T, literals: FnvHashSet<Datum>) -> Self {
263278
debug_assert!(op.is_set());
264279
Self { op, term, literals }
265280
}

0 commit comments

Comments
 (0)