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

Function collection_attribute

src/plan/join.rs:183–227  ·  view source on GitHub ↗
(
    nested: &mut Iterative<'b, S, u64>,
    context: &mut I,
    target_variables: &[Var],
    left: CollectionRelation<'b, S>,
    right: AttributeBinding,
)

Source from the content-addressed store, hash-verified

181}
182
183fn collection_attribute<'b, T, S, I>(
184 nested: &mut Iterative<'b, S, u64>,
185 context: &mut I,
186 target_variables: &[Var],
187 left: CollectionRelation<'b, S>,
188 right: AttributeBinding,
189) -> (Implemented<'b, S>, ShutdownHandle)
190where
191 T: Timestamp + Lattice,
192 I: ImplContext<T>,
193 S: Scope<Timestamp = T>,
194{
195 // @TODO specialized implementation
196
197 let (tuples, shutdown_propose) = match context.forward_propose(&right.source_attribute) {
198 None => panic!("attribute {:?} does not exist", &right.source_attribute),
199 Some(propose_trace) => {
200 let frontier: Vec<T> = propose_trace.advance_frontier().to_vec();
201 let (propose, shutdown_propose) =
202 propose_trace.import_core(&nested.parent, &right.source_attribute);
203
204 let tuples = propose
205 .enter_at(nested, move |_, _, time| {
206 let mut forwarded = time.clone();
207 forwarded.advance_by(&frontier);
208 Product::new(forwarded, 0)
209 })
210 .as_collection(|e, v| vec![e.clone(), v.clone()]);
211
212 (tuples, shutdown_propose)
213 }
214 };
215
216 let right_collected = CollectionRelation {
217 variables: vec![right.variables.0, right.variables.1],
218 tuples,
219 };
220
221 let (implemented, mut shutdown_handle) =
222 collection_collection(nested, context, target_variables, left, right_collected);
223
224 shutdown_handle.add_button(shutdown_propose);
225
226 (implemented, shutdown_handle)
227}
228
229// Some(var) => {
230// assert!(*var == self.variables.1);

Callers 1

implementMethod · 0.85

Calls 3

collection_collectionFunction · 0.85
forward_proposeMethod · 0.80
add_buttonMethod · 0.80

Tested by

no test coverage detected