MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / demand

Method demand

src/expr/src/linear.rs:875–888  ·  view source on GitHub ↗

Lists input columns whose values are used in outputs. You can use `BTreeSet::last()` to extract the maximum demanded column from the set. It is entirely appropriate to determine the demand of an instance and then both apply a projection to the subject of the instance and `self.permute` this instance.

(&self)

Source from the content-addressed store, hash-verified

873 /// and then both apply a projection to the subject of the instance and
874 /// `self.permute` this instance.
875 pub fn demand(&self) -> BTreeSet<usize> {
876 let mut demanded = BTreeSet::new();
877 for (_index, pred) in self.predicates.iter() {
878 demanded.extend(pred.support());
879 }
880 demanded.extend(self.projection.iter().cloned());
881 for index in (0..self.expressions.len()).rev() {
882 if demanded.contains(&(self.input_arity + index)) {
883 demanded.extend(self.expressions[index].support());
884 }
885 }
886 demanded.retain(|col| col < &self.input_arity);
887 demanded
888 }
889
890 /// Update input column references, due to an input projection or permutation.
891 ///

Callers 6

buildMethod · 0.80
extract_commonMethod · 0.80
build_compute_dataflowFunction · 0.80
render_reduceMethod · 0.80
as_collection_coreMethod · 0.80

Calls 5

iterMethod · 0.45
extendMethod · 0.45
supportMethod · 0.45
lenMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected