datafusion_physical_expr::equivalence

Function collapse_lex_req

Source
pub fn collapse_lex_req(input: LexRequirement) -> LexRequirement
Expand description

This function constructs a duplicate-free LexOrderingReq by filtering out duplicate entries that have same physical expression inside. For example, vec![a Some(ASC), a Some(DESC)] collapses to vec![a Some(ASC)].

It will also filter out entries that are ordered if the next entry is; for instance, vec![floor(a) Some(ASC), a Some(ASC)] will be collapsed to vec![a Some(ASC)].