-
Notifications
You must be signed in to change notification settings - Fork 21
Add 'orgchart' example similar to Differential Dataflow first example. #286
Conversation
Signed-off-by: Ben Pfaff <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #286 +/- ##
==========================================
- Coverage 84.03% 79.60% -4.44%
==========================================
Files 156 162 +6
Lines 28387 30139 +1752
==========================================
+ Hits 23856 23993 +137
- Misses 4531 6146 +1615
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks! Not sure what happened in CI. Will have a look.
examples/orgchart.rs
Outdated
type Weight = i32; | ||
type SkipLevels = OrdIndexedZSet<EmployeeID, SkipLevel, Weight>; | ||
|
||
fn print_output(output: &OutputHandle<OrdIndexedZSet<usize, SkipLevel, Weight>>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usize
-> EmployeeID
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with my push just now.
examples/orgchart.rs
Outdated
let skiplevels: Stream<_, SkipLevels> = manages_by_employee | ||
.join_index::<(), _, _, _, _, _>(&manages_by_manager, |common, m1, m2| { | ||
Some(( | ||
*common, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure you need to index output by common
. Could you just output OrdZSet<SkipLevel, Weight>
instead of OrdIndexedZSet<usize, SkipLevel, Weight>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, thanks for pointing that out. I thought that smelled funny but I didn't understand the difference between join
and join_index
. I fixed it with my push just a minute ago.
Yes, Agreed about |
Add derive's for `Encode` and `Decode` in the `orgchart` example, so that it compiles with persistence enabled.
I didn't understand that the difference between 'join' and 'join_index' was that the latter indexes the output stream. The example did not use the index, so we can omit it. This commit does so. Signed-off-by: Ben Pfaff <[email protected]>
How about filing issues for the problems you discovered with APIs? |
Closing in favor of PR #295. |
This is my first try at using DBSP. I'm sure stuff is wrong.
The most puzzling thing here for me is in print_output(). It seems
like there should be an easier way to iterate through the output
than two levels of key/value advancement. It also seems odd that
cursor.weight() mutates the cursor.
Signed-off-by: Ben Pfaff [email protected]