MCPcopy Create free account
hub / github.com/PRQL/prql / exclude

Function exclude

prqlc/prqlc/src/sql/gen_projection.rs:72–81  ·  view source on GitHub ↗

When compiling: from employees | group department (take 3) Row number will be computed in a CTE that also contains a star. In the main query, star will also include row number, which was not requested. This function adds that column to the exclusion tuple.

(star: &mut Option<(CId, HashSet<CId>)>, excluded: &mut Excluded)

Source from the content-addressed store, hash-verified

70 // requested.
71 // This function adds that column to the exclusion tuple.
72 fn exclude(star: &mut Option<(CId, HashSet<CId>)>, excluded: &mut Excluded) {
73 let Some((cid, in_star)) = star.take() else {
74 return;
75 };
76 if in_star.is_empty() {
77 return;
78 }
79
80 excluded.insert(cid, in_star);
81 }
82
83 let mut output = Vec::new();
84 for cid in cols {

Callers 1

translate_wildcardsFunction · 0.85

Calls 2

is_emptyMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected