Enum FieldSelection
pub enum FieldSelection {
All,
Fields(Box<IndexMap<PlSmallStr, FieldSelection, RandomState>>),
Element(Box<FieldSelection>),
}lazy only.Expand description
Which parts of one column’s value are needed.
Built by projection pushdown, which reads struct fields by name; non-struct values are always
All. See agent-docs/nested-projection-pushdown/01-field-pruning.md.
Variants§
All
The whole value (every field, recursively). The default; all non-nested columns.
Fields(Box<IndexMap<PlSmallStr, FieldSelection, RandomState>>)
Only these struct fields, each with its own selection. Empty: only the row count and the
outer validity are needed (s.is_null(), len).
Element(Box<FieldSelection>)
The element of a List or Array, with its own selection, plus the offsets and validity
of the list. Never Element(All), which is All.
Implementations§
§impl FieldSelection
impl FieldSelection
pub fn validity_only() -> FieldSelection
pub fn validity_only() -> FieldSelection
Only the row count and the outer validity.
pub fn field(name: PlSmallStr, selection: FieldSelection) -> FieldSelection
pub fn field(name: PlSmallStr, selection: FieldSelection) -> FieldSelection
Only the field name, with selection.
pub fn element(selection: FieldSelection) -> FieldSelection
pub fn element(selection: FieldSelection) -> FieldSelection
The element of a list or array with selection; All if selection is.
pub fn is_all(&self) -> bool
pub fn fields( &self, ) -> Option<&IndexMap<PlSmallStr, FieldSelection, RandomState>>
pub fn child(&self, name: &str) -> Option<&FieldSelection>
pub fn child(&self, name: &str) -> Option<&FieldSelection>
The selection of field name: All under All, None if the field is not needed.
All for an element selection, which has no fields.
pub fn element_selection(&self) -> &FieldSelection
pub fn element_selection(&self) -> &FieldSelection
The selection of the element of a list: All unless an element selection.
pub fn union(&mut self, other: FieldSelection)
pub fn union(&mut self, other: FieldSelection)
Merges the needs of another consumer of the same value into self. All absorbs
everything, field maps merge key by key and validity-only is absorbed by any selection.
pub fn insert_child(&mut self, name: PlSmallStr, selection: FieldSelection)
pub fn insert_child(&mut self, name: PlSmallStr, selection: FieldSelection)
Unions field name with selection into self. Does nothing under All; makes an
element selection All, as it has no fields.
pub fn normalize(self, dtype: &DataType) -> FieldSelection
pub fn normalize(self, dtype: &DataType) -> FieldSelection
Makes the selection canonical for dtype: non-struct values and structs with every field
selected whole become All, and fields that dtype does not have are dropped.
pub fn prune_dtype(&self, dtype: &DataType) -> DataType
pub fn prune_dtype(&self, dtype: &DataType) -> DataType
The dtype with only the selected fields, in the order of dtype.
pub fn prune_arrow_field(&self, field: &Field) -> Field
pub fn prune_arrow_field(&self, field: &Field) -> Field
Self::prune_dtype for an arrow field: field with only the selected struct fields.
pub fn prune_arrow_dtype(&self, dtype: &ArrowDataType) -> ArrowDataType
pub fn prune_arrow_dtype(&self, dtype: &ArrowDataType) -> ArrowDataType
Self::prune_dtype for an arrow dtype. Only plain structs and lists are pruned:
anything else is kept whole.
pub fn intersect(&self, other: &FieldSelection) -> FieldSelection
pub fn intersect(&self, other: &FieldSelection) -> FieldSelection
What both self and other, two selections of one value, select. self if they are not
from one dtype.
pub fn of_target_dtype(dtype: &DataType, target: &DataType) -> FieldSelection
pub fn of_target_dtype(dtype: &DataType, target: &DataType) -> FieldSelection
The fields of dtype that target has, matched by name, recursively: what a cast of
dtype to target that ignores extra struct fields keeps. A field target has and
dtype lacks is left out; a struct none of whose fields target has is needed for its
validity only.
pub fn of_narrowed_dtype(
dtype: &DataType,
narrowed: &DataType,
) -> FieldSelection
pub fn of_narrowed_dtype( dtype: &DataType, narrowed: &DataType, ) -> FieldSelection
The fields of dtype that narrowed, dtype with some struct fields left out, has. Like
Self::of_target_dtype, but a struct narrowed has a field of that dtype lacks is not
a narrowing of it, and is read whole.
Trait Implementations§
§impl Clone for FieldSelection
impl Clone for FieldSelection
§fn clone(&self) -> FieldSelection
fn clone(&self) -> FieldSelection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for FieldSelection
impl Debug for FieldSelection
§impl Default for FieldSelection
impl Default for FieldSelection
§fn default() -> FieldSelection
fn default() -> FieldSelection
§impl<'de> Deserialize<'de> for FieldSelection
impl<'de> Deserialize<'de> for FieldSelection
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FieldSelection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FieldSelection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Display for FieldSelection
impl Display for FieldSelection
impl Eq for FieldSelection
§impl Hash for FieldSelection
impl Hash for FieldSelection
§impl PartialEq for FieldSelection
impl PartialEq for FieldSelection
§impl Serialize for FieldSelection
impl Serialize for FieldSelection
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for FieldSelection
Auto Trait Implementations§
impl Freeze for FieldSelection
impl RefUnwindSafe for FieldSelection
impl Send for FieldSelection
impl Sync for FieldSelection
impl Unpin for FieldSelection
impl UnsafeUnpin for FieldSelection
impl UnwindSafe for FieldSelection
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
impl<T> PlanCallbackArgs for T
impl<T> PlanCallbackOut for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more