pub struct Reference { /* private fields */ }
Expand description
A named reference in an unbound expression.
For example, a
in a > 10
.
Implementations§
Source§impl Reference
impl Reference
Sourcepub fn less_than(self, datum: Datum) -> Predicate
pub fn less_than(self, datum: Datum) -> Predicate
Creates an less than expression. For example, a < 10
.
§Example
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").less_than(Datum::long(10));
assert_eq!(&format!("{expr}"), "a < 10");
Sourcepub fn less_than_or_equal_to(self, datum: Datum) -> Predicate
pub fn less_than_or_equal_to(self, datum: Datum) -> Predicate
Creates an less than or equal to expression. For example, a <= 10
.
§Example
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").less_than_or_equal_to(Datum::long(10));
assert_eq!(&format!("{expr}"), "a <= 10");
Sourcepub fn greater_than(self, datum: Datum) -> Predicate
pub fn greater_than(self, datum: Datum) -> Predicate
Creates an greater than expression. For example, a > 10
.
§Example
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").greater_than(Datum::long(10));
assert_eq!(&format!("{expr}"), "a > 10");
Sourcepub fn greater_than_or_equal_to(self, datum: Datum) -> Predicate
pub fn greater_than_or_equal_to(self, datum: Datum) -> Predicate
Creates a greater-than-or-equal-to than expression. For example, a >= 10
.
§Example
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").greater_than_or_equal_to(Datum::long(10));
assert_eq!(&format!("{expr}"), "a >= 10");
Sourcepub fn equal_to(self, datum: Datum) -> Predicate
pub fn equal_to(self, datum: Datum) -> Predicate
Creates an equal-to expression. For example, a = 10
.
§Example
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").equal_to(Datum::long(10));
assert_eq!(&format!("{expr}"), "a = 10");
Sourcepub fn not_equal_to(self, datum: Datum) -> Predicate
pub fn not_equal_to(self, datum: Datum) -> Predicate
Creates a not equal-to expression. For example, a!= 10
.
§Example
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").not_equal_to(Datum::long(10));
assert_eq!(&format!("{expr}"), "a != 10");
Sourcepub fn starts_with(self, datum: Datum) -> Predicate
pub fn starts_with(self, datum: Datum) -> Predicate
Creates a start-with expression. For example, a STARTS WITH "foo"
.
§Example
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").starts_with(Datum::string("foo"));
assert_eq!(&format!("{expr}"), r#"a STARTS WITH "foo""#);
Sourcepub fn not_starts_with(self, datum: Datum) -> Predicate
pub fn not_starts_with(self, datum: Datum) -> Predicate
Creates a not start-with expression. For example, a NOT STARTS WITH 'foo'
.
§Example
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").not_starts_with(Datum::string("foo"));
assert_eq!(&format!("{expr}"), r#"a NOT STARTS WITH "foo""#);
Sourcepub fn is_nan(self) -> Predicate
pub fn is_nan(self) -> Predicate
Creates an is-nan expression. For example, a IS NAN
.
§Example
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").is_nan();
assert_eq!(&format!("{expr}"), "a IS NAN");
Sourcepub fn is_not_nan(self) -> Predicate
pub fn is_not_nan(self) -> Predicate
Creates an is-not-nan expression. For example, a IS NOT NAN
.
§Example
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").is_not_nan();
assert_eq!(&format!("{expr}"), "a IS NOT NAN");
Sourcepub fn is_null(self) -> Predicate
pub fn is_null(self) -> Predicate
Creates an is-null expression. For example, a IS NULL
.
§Example
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").is_null();
assert_eq!(&format!("{expr}"), "a IS NULL");
Sourcepub fn is_not_null(self) -> Predicate
pub fn is_not_null(self) -> Predicate
Creates an is-not-null expression. For example, a IS NOT NULL
.
§Example
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").is_not_null();
assert_eq!(&format!("{expr}"), "a IS NOT NULL");
Sourcepub fn is_in(self, literals: impl IntoIterator<Item = Datum>) -> Predicate
pub fn is_in(self, literals: impl IntoIterator<Item = Datum>) -> Predicate
Creates an is-in expression. For example, a IS IN (5, 6)
.
§Example
use fnv::FnvHashSet;
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").is_in([Datum::long(5), Datum::long(6)]);
let as_string = format!("{expr}");
assert!(&as_string == "a IN (5, 6)" || &as_string == "a IN (6, 5)");
Sourcepub fn is_not_in(self, literals: impl IntoIterator<Item = Datum>) -> Predicate
pub fn is_not_in(self, literals: impl IntoIterator<Item = Datum>) -> Predicate
Creates an is-not-in expression. For example, a IS NOT IN (5, 6)
.
§Example
use fnv::FnvHashSet;
use iceberg::expr::Reference;
use iceberg::spec::Datum;
let expr = Reference::new("a").is_not_in([Datum::long(5), Datum::long(6)]);
let as_string = format!("{expr}");
assert!(&as_string == "a NOT IN (5, 6)" || &as_string == "a NOT IN (6, 5)");
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Reference
impl<'de> Deserialize<'de> for Reference
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Reference
Auto Trait Implementations§
impl Freeze for Reference
impl RefUnwindSafe for Reference
impl Send for Reference
impl Sync for Reference
impl Unpin for Reference
impl UnwindSafe for Reference
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more