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

Method implement

src/plan/mod.rs:371–538  ·  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

369 }
370
371 fn implement<'b, T, I, S>(
372 &self,
373 nested: &mut Iterative<'b, S, u64>,
374 local_arrangements: &VariableMap<Iterative<'b, S, u64>>,
375 context: &mut I,
376 ) -> (Implemented<'b, S>, ShutdownHandle)
377 where
378 T: Timestamp + Lattice,
379 I: ImplContext<T>,
380 S: Scope<Timestamp = T>,
381 {
382 match *self {
383 Plan::Project(ref projection) => {
384 projection.implement(nested, local_arrangements, context)
385 }
386 Plan::Aggregate(ref aggregate) => {
387 aggregate.implement(nested, local_arrangements, context)
388 }
389 Plan::Union(ref union) => union.implement(nested, local_arrangements, context),
390 Plan::Join(ref join) => join.implement(nested, local_arrangements, context),
391 Plan::Hector(ref hector) => hector.implement(nested, local_arrangements, context),
392 Plan::Antijoin(ref antijoin) => antijoin.implement(nested, local_arrangements, context),
393 Plan::Negate(ref plan) => {
394 let (relation, mut shutdown_handle) =
395 plan.implement(nested, local_arrangements, context);
396 let variables = relation.variables();
397
398 let tuples = {
399 let (projected, shutdown) = relation.projected(nested, context, &variables);
400 shutdown_handle.merge_with(shutdown);
401
402 projected.negate()
403 };
404
405 (
406 Implemented::Collection(CollectionRelation { variables, tuples }),
407 shutdown_handle,
408 )
409 }
410 Plan::Filter(ref filter) => filter.implement(nested, local_arrangements, context),
411 Plan::Transform(ref transform) => {
412 transform.implement(nested, local_arrangements, context)
413 }
414 Plan::MatchA(e, ref a, v) => {
415 let binding = AttributeBinding {
416 variables: (e, v),
417 source_attribute: a.to_string(),
418 };
419
420 (Implemented::Attribute(binding), ShutdownHandle::empty())
421 }
422 Plan::MatchEA(match_e, ref a, sym1) => {
423 let (tuples, shutdown_propose) = match context.forward_propose(a) {
424 None => panic!("attribute {:?} does not exist", a),
425 Some(propose_trace) => {
426 let frontier: Vec<T> = propose_trace.advance_frontier().to_vec();
427 let (propose, shutdown_propose) =
428 propose_trace.import_core(&nested.parent, a);

Callers

nothing calls this directly

Calls 6

projectedMethod · 0.80
merge_withMethod · 0.80
forward_proposeMethod · 0.80
is_underconstrainedMethod · 0.80
global_arrangementMethod · 0.80
variablesMethod · 0.45

Tested by

no test coverage detected