MCPcopy Create free account
hub / github.com/comnik/declarative-dataflow / implement

Method implement

src/plan/pull.rs:90–233  ·  view source on GitHub ↗
(
        &self,
        nested: &mut Iterative<'b, S, u64>,
        local_arrangements: &VariableMap<Iterative<'b, S, u64>>,
        context: &mut I,
    )

Source from the content-addressed store, hash-verified

88 }
89
90 fn implement<'b, T, I, S>(
91 &self,
92 nested: &mut Iterative<'b, S, u64>,
93 local_arrangements: &VariableMap<Iterative<'b, S, u64>>,
94 context: &mut I,
95 ) -> (Implemented<'b, S>, ShutdownHandle)
96 where
97 T: Timestamp + Lattice,
98 I: ImplContext<T>,
99 S: Scope<Timestamp = T>,
100 {
101 use differential_dataflow::operators::arrange::{Arrange, Arranged, TraceAgent};
102 use differential_dataflow::operators::JoinCore;
103 use differential_dataflow::trace::implementations::ord::OrdValSpine;
104 use differential_dataflow::trace::TraceReader;
105
106 let (input, mut shutdown_handle) = self.plan.implement(nested, local_arrangements, context);
107
108 if self.pull_attributes.is_empty() {
109 if self.path_attributes.is_empty() {
110 // nothing to pull
111 (input, shutdown_handle)
112 } else {
113 let path_attributes = self.path_attributes.clone();
114 let tuples = {
115 let (tuples, shutdown) = input.tuples(nested, context);
116 shutdown_handle.merge_with(shutdown);
117
118 tuples.map(move |tuple| interleave(&tuple, &path_attributes))
119 };
120
121 (
122 Implemented::Collection(CollectionRelation {
123 variables: self.variables.to_vec(),
124 tuples,
125 }),
126 shutdown_handle,
127 )
128 }
129 } else {
130 // Arrange input entities by eid.
131 let e_offset = input
132 .binds(self.pull_variable)
133 .expect("input relation doesn't bind pull_variable");
134
135 let paths = {
136 let (tuples, shutdown) = input.tuples(nested, context);
137 shutdown_handle.merge_with(shutdown);
138 tuples
139 };
140
141 let e_path: Arranged<
142 Iterative<S, u64>,
143 TraceAgent<OrdValSpine<Value, Vec<Value>, Product<T, u64>, isize>>,
144 > = paths.map(move |t| (t[e_offset].clone(), t)).arrange();
145
146 let mut shutdown_handle = shutdown_handle;
147 let streams = self.pull_attributes.iter().map(|a| {

Callers

nothing calls this directly

Calls 6

tuplesMethod · 0.80
merge_withMethod · 0.80
forward_proposeMethod · 0.80
add_buttonMethod · 0.80
interleaveFunction · 0.70
bindsMethod · 0.45

Tested by

no test coverage detected