Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
EquivalenceClass in datafusion::physical_expr::equivalence - Rust
[go: Go Back, main page]

Struct EquivalenceClass

Source
pub struct EquivalenceClass { /* private fields */ }
Expand description

An EquivalenceClass is a set of Arc<dyn PhysicalExpr>s that are known to have the same value for all tuples in a relation. These are generated by equality predicates (e.g. a = b), typically equi-join conditions and equality conditions in filters.

Two EquivalenceClasses are equal if they contains the same expressions in without any ordering.

Implementations§

Source§

impl EquivalenceClass

Source

pub fn new( exprs: impl IntoIterator<Item = Arc<dyn PhysicalExpr>>, ) -> EquivalenceClass

Source

pub fn canonical_expr(&self) -> Option<&Arc<dyn PhysicalExpr>>

Return the “canonical” expression for this class (the first element) if non-empty.

Source

pub fn push(&mut self, expr: Arc<dyn PhysicalExpr>)

Insert the expression into this class, meaning it is known to be equal to all other expressions in this class.

Source

pub fn extend(&mut self, other: EquivalenceClass)

Inserts all the expressions from other into this class.

Source

pub fn contains_any(&self, other: &EquivalenceClass) -> bool

Returns whether this equivalence class has any entries in common with other.

Source

pub fn is_trivial(&self) -> bool

Returns whether this equivalence class is trivial, meaning that it is either empty, or contains a single expression that is not a constant. Such classes are not useful, and can be removed from equivalence groups.

Source

pub fn try_with_offset( &self, offset: isize, ) -> Result<EquivalenceClass, DataFusionError>

Adds the given offset to all columns in the expressions inside this class. This is used when schemas are appended, e.g. in joins.

Methods from Deref<Target = IndexSet<Arc<dyn PhysicalExpr>>>§

Source

pub fn capacity(&self) -> usize

Return the number of elements the set can hold without reallocating.

This number is a lower bound; the set might be able to hold more, but is guaranteed to be able to hold at least this many.

Computes in O(1) time.

Source

pub fn hasher(&self) -> &S

Return a reference to the set’s BuildHasher.

Source

pub fn len(&self) -> usize

Return the number of elements in the set.

Computes in O(1) time.

Source

pub fn is_empty(&self) -> bool

Returns true if the set contains no elements.

Computes in O(1) time.

Source

pub fn iter(&self) -> Iter<'_, T>

Return an iterator over the values of the set, in their order

Source

pub fn difference<'a, S2>( &'a self, other: &'a IndexSet<T, S2>, ) -> Difference<'a, T, S2>
where S2: BuildHasher,

Return an iterator over the values that are in self but not other.

Values are produced in the same order that they appear in self.

Source

pub fn symmetric_difference<'a, S2>( &'a self, other: &'a IndexSet<T, S2>, ) -> SymmetricDifference<'a, T, S, S2>
where S2: BuildHasher,

Return an iterator over the values that are in self or other, but not in both.

Values from self are produced in their original order, followed by values from other in their original order.

Source

pub fn intersection<'a, S2>( &'a self, other: &'a IndexSet<T, S2>, ) -> Intersection<'a, T, S2>
where S2: BuildHasher,

Return an iterator over the values that are in both self and other.

Values are produced in the same order that they appear in self.

Source

pub fn union<'a, S2>(&'a self, other: &'a IndexSet<T, S2>) -> Union<'a, T, S>
where S2: BuildHasher,

Return an iterator over all values that are in self or other.

Values from self are produced in their original order, followed by values that are unique to other in their original order.

Source

pub fn contains<Q>(&self, value: &Q) -> bool
where Q: Hash + Equivalent<T> + ?Sized,

Return true if an equivalent to value exists in the set.

Computes in O(1) time (average).

Source

pub fn get<Q>(&self, value: &Q) -> Option<&T>
where Q: Hash + Equivalent<T> + ?Sized,

Return a reference to the value stored in the set, if it is present, else None.

Computes in O(1) time (average).

Source

pub fn get_full<Q>(&self, value: &Q) -> Option<(usize, &T)>
where Q: Hash + Equivalent<T> + ?Sized,

Return item index and value

Source

pub fn get_index_of<Q>(&self, value: &Q) -> Option<usize>
where Q: Hash + Equivalent<T> + ?Sized,

Return item index, if it exists in the set

Computes in O(1) time (average).

Search over a sorted set for a value.

Returns the position where that value is present, or the position where it can be inserted to maintain the sort. See slice::binary_search for more details.

Computes in O(log(n)) time, which is notably less scalable than looking the value up using get_index_of, but this can also position missing values.

Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where F: FnMut(&'a T) -> Ordering,

Search over a sorted set with a comparator function.

Returns the position where that value is present, or the position where it can be inserted to maintain the sort. See slice::binary_search_by for more details.

Computes in O(log(n)) time.

Source

pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F, ) -> Result<usize, usize>
where F: FnMut(&'a T) -> B, B: Ord,

Search over a sorted set with an extraction function.

Returns the position where that value is present, or the position where it can be inserted to maintain the sort. See slice::binary_search_by_key for more details.

Computes in O(log(n)) time.

Source

pub fn partition_point<P>(&self, pred: P) -> usize
where P: FnMut(&T) -> bool,

Returns the index of the partition point of a sorted set according to the given predicate (the index of the first element of the second partition).

See slice::partition_point for more details.

Computes in O(log(n)) time.

Source

pub fn as_slice(&self) -> &Slice<T>

Returns a slice of all the values in the set.

Computes in O(1) time.

Source

pub fn get_index(&self, index: usize) -> Option<&T>

Get a value by index

Valid indices are 0 <= index < self.len().

Computes in O(1) time.

Source

pub fn get_range<R>(&self, range: R) -> Option<&Slice<T>>
where R: RangeBounds<usize>,

Returns a slice of values in the given range of indices.

Valid indices are 0 <= index < self.len().

Computes in O(1) time.

Source

pub fn first(&self) -> Option<&T>

Get the first value

Computes in O(1) time.

Source

pub fn last(&self) -> Option<&T>

Get the last value

Computes in O(1) time.

Source

pub fn is_disjoint<S2>(&self, other: &IndexSet<T, S2>) -> bool
where S2: BuildHasher,

Returns true if self has no elements in common with other.

Source

pub fn is_subset<S2>(&self, other: &IndexSet<T, S2>) -> bool
where S2: BuildHasher,

Returns true if all elements of self are contained in other.

Source

pub fn is_superset<S2>(&self, other: &IndexSet<T, S2>) -> bool
where S2: BuildHasher,

Returns true if all elements of other are contained in self.

Trait Implementations§

Source§

impl Clone for EquivalenceClass

Source§

fn clone(&self) -> EquivalenceClass

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EquivalenceClass

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for EquivalenceClass

Source§

fn default() -> EquivalenceClass

Returns the “default value” for a type. Read more
Source§

impl Deref for EquivalenceClass

Source§

type Target = IndexSet<Arc<dyn PhysicalExpr>>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<EquivalenceClass as Deref>::Target

Dereferences the value.
Source§

impl Display for EquivalenceClass

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<EquivalenceClass> for Vec<Arc<dyn PhysicalExpr>>

Source§

fn from(cls: EquivalenceClass) -> Vec<Arc<dyn PhysicalExpr>>

Converts to this type from the input type.
Source§

impl IntoIterator for EquivalenceClass

Source§

type Item = Arc<dyn PhysicalExpr>

The type of the elements being iterated over.
Source§

type IntoIter = <IndexSet<<EquivalenceClass as IntoIterator>::Item> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <EquivalenceClass as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq for EquivalenceClass

Source§

fn eq(&self, other: &EquivalenceClass) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for EquivalenceClass

Source§

impl StructuralPartialEq for EquivalenceClass

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynEq for T
where T: Eq + Any,

Source§

fn dyn_eq(&self, other: &(dyn Any + 'static)) -> bool

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Ungil for T
where T: Send,