pub enum Volatility {
Immutable,
Stable,
Volatile,
}
Expand description
A function’s volatility, which defines the functions eligibility for certain optimizations
Variants§
Immutable
An immutable function will always return the same output when given the same input. DataFusion will attempt to inline immutable functions during planning.
Stable
A stable function may return different values given the same input across different
queries but must return the same value for a given input within a query. An example of
this is the Now
function. DataFusion will attempt to inline Stable
functions
during planning, when possible.
For query select col1, now() from t1
, it might take a while to execute but
now()
column will be the same for each output row, which is evaluated
during planning.
Volatile
A volatile function may change the return value from evaluation to evaluation.
Multiple invocations of a volatile function may return different results when used in the
same query. An example of this is the random() function. DataFusion
can not evaluate such functions during planning.
In the query select col1, random() from t1
, random()
function will be evaluated
for each output row, resulting in a unique random value for each row.
Trait Implementations§
Source§impl Clone for Volatility
impl Clone for Volatility
Source§fn clone(&self) -> Volatility
fn clone(&self) -> Volatility
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Volatility
impl Debug for Volatility
Source§impl Hash for Volatility
impl Hash for Volatility
Source§impl Ord for Volatility
impl Ord for Volatility
Source§fn cmp(&self, other: &Volatility) -> Ordering
fn cmp(&self, other: &Volatility) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Volatility
impl PartialEq for Volatility
Source§impl PartialOrd for Volatility
impl PartialOrd for Volatility
impl Copy for Volatility
impl Eq for Volatility
impl StructuralPartialEq for Volatility
Auto Trait Implementations§
impl Freeze for Volatility
impl RefUnwindSafe for Volatility
impl Send for Volatility
impl Sync for Volatility
impl Unpin for Volatility
impl UnwindSafe for Volatility
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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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