MCPcopy Create free account
hub / github.com/apache/datafusion / construct

Method construct

datafusion/physical-expr-common/src/sort_expr.rs:617–626  ·  view source on GitHub ↗

Constructs a new `LexRequirement` from the given sort requirements w/o enforcing non-degeneracy. This function is used internally and is not meant (or safe) for external use.

(
        reqs: impl IntoIterator<Item = PhysicalSortRequirement>,
    )

Source from the content-addressed store, hash-verified

615 /// enforcing non-degeneracy. This function is used internally and is not
616 /// meant (or safe) for external use.
617 fn construct(
618 reqs: impl IntoIterator<Item = PhysicalSortRequirement>,
619 ) -> (bool, Self) {
620 let mut set = HashSet::new();
621 let reqs = reqs
622 .into_iter()
623 .filter_map(|r| set.insert(Arc::clone(&r.expr)).then_some(r))
624 .collect();
625 (!set.is_empty(), Self { reqs })
626 }
627}
628
629impl<const N: usize> From<[PhysicalSortRequirement; N]> for LexRequirement {

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
collectMethod · 0.80
into_iterMethod · 0.45
insertMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected