Skip to content

Commit abe8b95

Browse files
committed
Deploying to gh-pages from @ a6eee82 🚀
1 parent a7a155f commit abe8b95

File tree

4 files changed

+8
-82
lines changed

4 files changed

+8
-82
lines changed

chapter_5/chapter_5_4.html

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -156,46 +156,9 @@ <h1 id="trace-wrappers"><a class="header" href="#trace-wrappers">Trace wrappers<
156156
<p>There are many cases where we make small manipulations of a collection, and we might hope to retain the arrangement structure rather than re-build and maintain new arrangements. In some cases this is possible, using what we call <em>trace wrappers</em>.</p>
157157
<p>The set of trace wrappers grows as more idioms are discovered and implemented, but the intent is that we can often avoid reforming new collections, and instead just push logic into a layer around the arrangement.</p>
158158
<h2 id="filter"><a class="header" href="#filter">Filter</a></h2>
159-
<p>Like a collection, an arrangement supports the <code>filter(predicate)</code> operator that reduces the data down to those elements satisfying <code>predicate</code>. Unlike a collection, which produces a new collection when filtered, a filtered arrangement is just a wrapper around the existing arrangement.</p>
160-
<p>The following example uses two different collections in its two joins, but one is a filtered version of the other and can re-use the same arrangement.</p>
161-
<pre><pre class="playground"><code class="language-rust">extern crate timely;
162-
extern crate differential_dataflow;
163-
164-
use differential_dataflow::operators::JoinCore;
165-
use differential_dataflow::operators::arrange::ArrangeByKey;
166-
167-
fn main() {
168-
169-
// define a new timely dataflow computation.
170-
timely::execute_from_args(::std::env::args(), move |worker| {
171-
172-
let mut knows = differential_dataflow::input::InputSession::new();
173-
let mut query = differential_dataflow::input::InputSession::new();
174-
175-
worker.dataflow(|scope| {
176-
177-
let knows = knows.to_collection(scope);
178-
let query = query.to_collection(scope);
179-
180-
// Arrange the data first! (by key).
181-
let knows1 = knows.arrange_by_key();
182-
183-
// Filter to equal pairs (for some reason).
184-
let knows2 = knows1.filter(|k,v| k == v);
185-
186-
// Same logic as before, with a new method name.
187-
query.join_core(&amp;knows1, |x,q,y| Some((*y,(*x,*q))))
188-
.join_core(&amp;knows2, |y,(x,q),z| Some((*q,(*x,*y,*z))))
189-
.inspect(|result| println!("result {:?}", result));
190-
191-
});
192-
193-
<span class="boring"> // to help with type inference ...
194-
</span><span class="boring"> knows.update_at((0,0), 0usize, 1isize);
195-
</span><span class="boring"> query.update_at((0,0), 0usize, 1isize);
196-
</span> });
197-
}</code></pre></pre>
198-
<p>Filtered arrangements are not always a win. If the input arrangement is large and the filtered arrangement is small, it may make more sense to build and maintain a second arrangement than to continually search through the large arrangement for records satisfying the predicate. If you would like to form a second arrangement, you can use <code>as_collection()</code> to return to a collection, filter the result, and then arrange it again.</p>
159+
<p>The filter wrapper has been deprecated.
160+
It's still a neat filter, but its existence was constraining the development velocity.
161+
Reach out if you worry this was wrong, and we can discuss alternatives!</p>
199162
<h2 id="entering-scopes"><a class="header" href="#entering-scopes">Entering scopes</a></h2>
200163
<p>Differential dataflow programs often contain nested scopes, used for loops and iteration. Collections in a nested scope have different timestamps than collections outside the scope, which means we can not immediately re-use arrangements from outside the scope inside the scope.</p>
201164
<p>Like collections, arrangements support an <code>enter(scope)</code> method for entering a scope, which will wrap the arrangement so that access to timestamps automatically enriches it as if the collection had entered the scope.</p>

print.html

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,46 +1193,9 @@ <h2 id="great-responsibility"><a class="header" href="#great-responsibility">Gre
11931193
<p>There are many cases where we make small manipulations of a collection, and we might hope to retain the arrangement structure rather than re-build and maintain new arrangements. In some cases this is possible, using what we call <em>trace wrappers</em>.</p>
11941194
<p>The set of trace wrappers grows as more idioms are discovered and implemented, but the intent is that we can often avoid reforming new collections, and instead just push logic into a layer around the arrangement.</p>
11951195
<h2 id="filter"><a class="header" href="#filter">Filter</a></h2>
1196-
<p>Like a collection, an arrangement supports the <code>filter(predicate)</code> operator that reduces the data down to those elements satisfying <code>predicate</code>. Unlike a collection, which produces a new collection when filtered, a filtered arrangement is just a wrapper around the existing arrangement.</p>
1197-
<p>The following example uses two different collections in its two joins, but one is a filtered version of the other and can re-use the same arrangement.</p>
1198-
<pre><pre class="playground"><code class="language-rust">extern crate timely;
1199-
extern crate differential_dataflow;
1200-
1201-
use differential_dataflow::operators::JoinCore;
1202-
use differential_dataflow::operators::arrange::ArrangeByKey;
1203-
1204-
fn main() {
1205-
1206-
// define a new timely dataflow computation.
1207-
timely::execute_from_args(::std::env::args(), move |worker| {
1208-
1209-
let mut knows = differential_dataflow::input::InputSession::new();
1210-
let mut query = differential_dataflow::input::InputSession::new();
1211-
1212-
worker.dataflow(|scope| {
1213-
1214-
let knows = knows.to_collection(scope);
1215-
let query = query.to_collection(scope);
1216-
1217-
// Arrange the data first! (by key).
1218-
let knows1 = knows.arrange_by_key();
1219-
1220-
// Filter to equal pairs (for some reason).
1221-
let knows2 = knows1.filter(|k,v| k == v);
1222-
1223-
// Same logic as before, with a new method name.
1224-
query.join_core(&amp;knows1, |x,q,y| Some((*y,(*x,*q))))
1225-
.join_core(&amp;knows2, |y,(x,q),z| Some((*q,(*x,*y,*z))))
1226-
.inspect(|result| println!("result {:?}", result));
1227-
1228-
});
1229-
1230-
<span class="boring"> // to help with type inference ...
1231-
</span><span class="boring"> knows.update_at((0,0), 0usize, 1isize);
1232-
</span><span class="boring"> query.update_at((0,0), 0usize, 1isize);
1233-
</span> });
1234-
}</code></pre></pre>
1235-
<p>Filtered arrangements are not always a win. If the input arrangement is large and the filtered arrangement is small, it may make more sense to build and maintain a second arrangement than to continually search through the large arrangement for records satisfying the predicate. If you would like to form a second arrangement, you can use <code>as_collection()</code> to return to a collection, filter the result, and then arrange it again.</p>
1196+
<p>The filter wrapper has been deprecated.
1197+
It's still a neat filter, but its existence was constraining the development velocity.
1198+
Reach out if you worry this was wrong, and we can discuss alternatives!</p>
12361199
<h2 id="entering-scopes"><a class="header" href="#entering-scopes">Entering scopes</a></h2>
12371200
<p>Differential dataflow programs often contain nested scopes, used for loops and iteration. Collections in a nested scope have different timestamps than collections outside the scope, which means we can not immediately re-use arrangements from outside the scope inside the scope.</p>
12381201
<p>Like collections, arrangements support an <code>enter(scope)</code> method for entering a scope, which will wrap the arrangement so that access to timestamps automatically enriches it as if the collection had entered the scope.</p>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

searchindex.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)