Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion differential-dataflow/examples/columnar/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ mod reachability {

// join_traces with ValColBuilder: produces Stream<_, RecordedUpdates<...>>.
let proposed =
join_traces::<_, _, _, ValColBuilder<(Node, (), IterTime, Diff)>>(
join_traces::<_, _, _, _, ValColBuilder<(Node, (), IterTime, Diff)>>(
edges_arr,
reach_arr,
|_src, dst, (), time, d1, d2, session| {
Expand Down
14 changes: 8 additions & 6 deletions differential-dataflow/src/operators/arrange/arrangement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
while let Some(key) = cursor.get_key(batch) {
while let Some(val) = cursor.get_val(batch) {
for datum in logic(key, val) {
cursor.map_times(batch, |time, diff| {

Check warning on line 208 in differential-dataflow/src/operators/arrange/arrangement.rs

View workflow job for this annotation

GitHub Actions / Cargo clippy

`time` shadows a previous, unrelated binding
session.give((datum.clone(), <BatchCursor<Tr> as Cursor>::owned_time(time), <BatchCursor<Tr> as Cursor>::owned_diff(diff)));
});
}
Expand All @@ -227,26 +227,28 @@
/// A convenience method to join and produce `VecCollection` output.
///
/// Avoid this method, as it is likely to evolve into one without the `VecCollection` opinion.
pub fn join_core<Tr2,I,L,R1,R2>(self, other: Arranged<'scope, Tr2>, mut result: L) -> VecCollection<'scope, Tr1::Time,I::Item,<R1 as Multiply<R2>>::Output>
pub fn join_core<Tr2,I,L,R1,R2,KC>(self, other: Arranged<'scope, Tr2>, mut result: L) -> VecCollection<'scope, Tr1::Time,I::Item,<R1 as Multiply<R2>>::Output>
where
Tr2: TraceReader<Batch: Navigable, Time=Tr1::Time>+Clone+'static,
// Pin the cursor diffs to named params `R1`/`R2`: a `Multiply` bound on a projection
// does not connect to its use-site (the solver normalizes the use but not the bound's
// subject), so we constrain plain params instead.
BatchCursor<Tr1>: Cursor<Diff = R1, Time = Tr1::Time>,
BatchCursor<Tr1>: Cursor<Diff = R1, Time = Tr1::Time, KeyContainer = KC>,
BatchCursor<Tr2>: Cursor<Diff = R2, Time = Tr1::Time>,
for<'a> BatchCursor<Tr2>: Cursor<Key<'a> = BatchKey<'a, Tr1>>,
KC: BatchContainer,
for<'a> BatchCursor<Tr1>: Cursor<Key<'a> = KC::ReadItem<'a>>,
for<'a> BatchCursor<Tr2>: Cursor<Key<'a> = KC::ReadItem<'a>>,
R1: Multiply<R2, Output: Semigroup+'static> + Clone,
I: IntoIterator<Item: Data>,
L: FnMut(BatchKey<'_, Tr1>,BatchVal<'_, Tr1>,BatchVal<'_, Tr2>)->I+'static
L: FnMut(KC::ReadItem<'_>,BatchVal<'_, Tr1>,BatchVal<'_, Tr2>)->I+'static
{
let mut result = move |k: BatchKey<'_, Tr1>, v1: BatchVal<'_, Tr1>, v2: BatchVal<'_, Tr2>, t: Tr1::Time, r1: &R1, r2: &R2| {
let mut result = move |k: KC::ReadItem<'_>, v1: BatchVal<'_, Tr1>, v2: BatchVal<'_, Tr2>, t: Tr1::Time, r1: &R1, r2: &R2| {
let r = (r1.clone()).multiply(r2);
result(k, v1, v2).into_iter().map(move |d| (d, t.clone(), r.clone()))
};

use crate::operators::join::join_traces;
join_traces::<_, _, _, crate::consolidation::ConsolidatingContainerBuilder<_>>(
join_traces::<_, _, _, _, crate::consolidation::ConsolidatingContainerBuilder<_>>(
self,
other,
move |k, v1, v2, t, d1, d2, c| {
Expand Down
13 changes: 8 additions & 5 deletions differential-dataflow/src/operators/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ use timely::dataflow::operators::Capability;

use crate::lattice::Lattice;
use crate::operators::arrange::Arranged;
use crate::trace::{BatchCursor, BatchDiff, BatchKey, BatchReader, BatchVal, Cursor, Navigable, TraceReader};
use crate::trace::{BatchCursor, BatchDiff, BatchReader, BatchVal, Cursor, Navigable, TraceReader};
use crate::trace::cursor::cursor_list;
use crate::trace::implementations::containers::BatchContainer;
use crate::operators::ValueHistory;

/// A type that can manage the joining of lists of batches.
Expand Down Expand Up @@ -59,13 +60,15 @@ pub enum Fresh {
/// The "correctness" of this method depends heavily on the behavior of the supplied `result` function.
///
/// [`AsCollection`]: crate::collection::AsCollection
pub fn join_traces<'scope, Tr1, Tr2, L, CB>(arranged1: Arranged<'scope, Tr1>, arranged2: Arranged<'scope, Tr2>, result: L) -> Stream<'scope, Tr1::Time, CB::Container>
pub fn join_traces<'scope, Tr1, Tr2, KC, L, CB>(arranged1: Arranged<'scope, Tr1>, arranged2: Arranged<'scope, Tr2>, result: L) -> Stream<'scope, Tr1::Time, CB::Container>
where
Tr1: TraceReader<Batch: Navigable>+'static,
Tr2: TraceReader<Batch: Navigable, Time = Tr1::Time>+'static,
BatchCursor<Tr1>: Cursor<Time = Tr1::Time>,
for<'a> BatchCursor<Tr2>: Cursor<Key<'a>=BatchKey<'a, Tr1>, Time = Tr1::Time>,
L: FnMut(BatchKey<'_, Tr1>,BatchVal<'_, Tr1>,BatchVal<'_, Tr2>,Tr1::Time,&BatchDiff<Tr1>,&BatchDiff<Tr2>,&mut CB)+'static,
KC: BatchContainer,
BatchCursor<Tr1>: Cursor<Time = Tr1::Time, KeyContainer = KC>,
for<'a> BatchCursor<Tr1>: Cursor<Key<'a> = KC::ReadItem<'a>>,
for<'a> BatchCursor<Tr2>: Cursor<Key<'a> = KC::ReadItem<'a>, Time = Tr1::Time>,
L: FnMut(KC::ReadItem<'_>,BatchVal<'_, Tr1>,BatchVal<'_, Tr2>,Tr1::Time,&BatchDiff<Tr1>,&BatchDiff<Tr2>,&mut CB)+'static,
CB: ContainerBuilder<Container: Default> + 'static,
{
join_with_tactic(arranged1, arranged2, cursors::CursorTactic::<Tr1::Batch, Tr2::Batch, _, CB>::new(result))
Expand Down
2 changes: 1 addition & 1 deletion interactive/src/backend/col.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ mod render {
use differential_dataflow::operators::join::join_traces;
use differential_dataflow::collection::AsCollection;
use super::columnar::ValColBuilder;
let stream = join_traces::<_, _, _, ValColBuilder<DdirUpdate>>(l, r, move |k, v1, v2, t, d1, d2, c| {
let stream = join_traces::<_, _, _, _, ValColBuilder<DdirUpdate>>(l, r, move |k, v1, v2, t, d1, d2, c| {
use differential_dataflow::difference::Multiply;
let d = d1.clone().multiply(d2);
let i = [k.as_slice(), v1.as_slice(), v2.as_slice()];
Expand Down
Loading