-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hydroflow_lang): add
all_once()
windowing operator (#1585)
TODO: ensure input is bounded.
- Loading branch information
1 parent
c9e4f94
commit 017e429
Showing
12 changed files
with
169 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
hydroflow/tests/compile-fail/surface_loop_missing_unwindowing.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
hydroflow/tests/compile-fail/surface_loop_missing_windowing.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
hydroflow/tests/compile-fail/surface_loop_multiple_window.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
hydroflow/tests/snapshots/surface_loop__flo_nested@graphvis_dot.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
source: hydroflow/tests/surface_loop.rs | ||
expression: "df.meta_graph().unwrap().to_dot(& Default :: default())" | ||
--- | ||
digraph { | ||
node [fontname="Monaco,Menlo,Consolas,"Droid Sans Mono",Inconsolata,"Courier New",monospace", style=filled]; | ||
edge [fontname="Monaco,Menlo,Consolas,"Droid Sans Mono",Inconsolata,"Courier New",monospace"]; | ||
n1v1 [label="(n1v1) source_iter([\"alice\", \"bob\"])", shape=invhouse, fillcolor="#88aaff"] | ||
n2v1 [label="(n2v1) source_stream(iter_batches_stream(0..12, 3))", shape=invhouse, fillcolor="#88aaff"] | ||
n3v1 [label="(n3v1) batch()", shape=invhouse, fillcolor="#88aaff"] | ||
n4v1 [label="(n4v1) flatten()", shape=invhouse, fillcolor="#88aaff"] | ||
n5v1 [label="(n5v1) batch()", shape=invhouse, fillcolor="#88aaff"] | ||
n6v1 [label="(n6v1) flatten()", shape=invhouse, fillcolor="#88aaff"] | ||
n7v1 [label="(n7v1) cross_join::<'static, 'tick>()", shape=invhouse, fillcolor="#88aaff"] | ||
n8v1 [label="(n8v1) all_once()", shape=invhouse, fillcolor="#88aaff"] | ||
n9v1 [label="(n9v1) for_each(|all| println!(\"{}: {:?}\", context.current_tick(), all))", shape=house, fillcolor="#ffff88"] | ||
n10v1 [label="(n10v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n11v1 [label="(n11v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n12v1 [label="(n12v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n4v1 -> n7v1 [label="0"] | ||
n3v1 -> n4v1 | ||
n1v1 -> n10v1 | ||
n6v1 -> n7v1 [label="1"] | ||
n5v1 -> n6v1 | ||
n2v1 -> n11v1 | ||
n8v1 -> n9v1 | ||
n7v1 -> n12v1 | ||
n10v1 -> n3v1 | ||
n11v1 -> n5v1 | ||
n12v1 -> n8v1 [color=red] | ||
subgraph "cluster n1v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_1v1\nstratum 0" | ||
n1v1 | ||
subgraph "cluster_sg_1v1_var_users" { | ||
label="var users" | ||
n1v1 | ||
} | ||
} | ||
subgraph "cluster n2v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_2v1\nstratum 0" | ||
n2v1 | ||
subgraph "cluster_sg_2v1_var_messages" { | ||
label="var messages" | ||
n2v1 | ||
} | ||
} | ||
subgraph "cluster n3v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_3v1\nstratum 0" | ||
n3v1 | ||
n4v1 | ||
n5v1 | ||
n6v1 | ||
n7v1 | ||
subgraph "cluster_sg_3v1_var_cp" { | ||
label="var cp" | ||
n7v1 | ||
} | ||
} | ||
subgraph "cluster n4v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_4v1\nstratum 1" | ||
n8v1 | ||
n9v1 | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
hydroflow/tests/snapshots/surface_loop__flo_nested@graphvis_mermaid.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
source: hydroflow/tests/surface_loop.rs | ||
expression: "df.meta_graph().unwrap().to_mermaid(& Default :: default())" | ||
--- | ||
%%{init:{'theme':'base','themeVariables':{'clusterBkg':'#ddd','clusterBorder':'#888'}}}%% | ||
flowchart TD | ||
classDef pullClass fill:#8af,stroke:#000,text-align:left,white-space:pre | ||
classDef pushClass fill:#ff8,stroke:#000,text-align:left,white-space:pre | ||
classDef otherClass fill:#fdc,stroke:#000,text-align:left,white-space:pre | ||
linkStyle default stroke:#aaa | ||
1v1[\"(1v1) <code>source_iter(["alice", "bob"])</code>"/]:::pullClass | ||
2v1[\"(2v1) <code>source_stream(iter_batches_stream(0..12, 3))</code>"/]:::pullClass | ||
3v1[\"(3v1) <code>batch()</code>"/]:::pullClass | ||
4v1[\"(4v1) <code>flatten()</code>"/]:::pullClass | ||
5v1[\"(5v1) <code>batch()</code>"/]:::pullClass | ||
6v1[\"(6v1) <code>flatten()</code>"/]:::pullClass | ||
7v1[\"(7v1) <code>cross_join::<'static, 'tick>()</code>"/]:::pullClass | ||
8v1[\"(8v1) <code>all_once()</code>"/]:::pullClass | ||
9v1[/"(9v1) <code>for_each(|all| println!("{}: {:?}", context.current_tick(), all))</code>"\]:::pushClass | ||
10v1["(10v1) <code>handoff</code>"]:::otherClass | ||
11v1["(11v1) <code>handoff</code>"]:::otherClass | ||
12v1["(12v1) <code>handoff</code>"]:::otherClass | ||
4v1-->|0|7v1 | ||
3v1-->4v1 | ||
1v1-->10v1 | ||
6v1-->|1|7v1 | ||
5v1-->6v1 | ||
2v1-->11v1 | ||
8v1-->9v1 | ||
7v1-->12v1 | ||
10v1-->3v1 | ||
11v1-->5v1 | ||
12v1--x8v1; linkStyle 10 stroke:red | ||
subgraph sg_1v1 ["sg_1v1 stratum 0"] | ||
1v1 | ||
subgraph sg_1v1_var_users ["var <tt>users</tt>"] | ||
1v1 | ||
end | ||
end | ||
subgraph sg_2v1 ["sg_2v1 stratum 0"] | ||
2v1 | ||
subgraph sg_2v1_var_messages ["var <tt>messages</tt>"] | ||
2v1 | ||
end | ||
end | ||
subgraph sg_3v1 ["sg_3v1 stratum 0"] | ||
3v1 | ||
4v1 | ||
5v1 | ||
6v1 | ||
7v1 | ||
subgraph sg_3v1_var_cp ["var <tt>cp</tt>"] | ||
7v1 | ||
end | ||
end | ||
subgraph sg_4v1 ["sg_4v1 stratum 1"] | ||
8v1 | ||
9v1 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use super::{DelayType, OperatorConstraints}; | ||
|
||
// Same as batch, but with a stratum barrier. | ||
/// TODO(mingwei): docs | ||
pub const ALL_ONCE: OperatorConstraints = OperatorConstraints { | ||
name: "all_once", | ||
input_delaytype_fn: |_| Some(DelayType::Stratum), | ||
..super::batch::BATCH | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters