-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt Materialize to use the columnated merge batcher #23121
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,8 +74,8 @@ pub(crate) type ErrArrangementImport<S, T> = Arranged< | |
/// of regions or iteration. | ||
pub struct Context<S: Scope, T = mz_repr::Timestamp> | ||
where | ||
T: Timestamp + Lattice, | ||
S::Timestamp: Lattice + Refines<T>, | ||
T: Timestamp + Lattice + Columnation, | ||
S::Timestamp: Lattice + Refines<T> + Columnation, | ||
{ | ||
/// The scope within which all managed collections exist. | ||
/// | ||
|
@@ -104,7 +104,7 @@ where | |
|
||
impl<S: Scope> Context<S> | ||
where | ||
S::Timestamp: Lattice + Refines<mz_repr::Timestamp>, | ||
S::Timestamp: Lattice + Refines<mz_repr::Timestamp> + Columnation, | ||
{ | ||
/// Creates a new empty Context. | ||
pub fn for_dataflow_in<Plan>( | ||
|
@@ -134,8 +134,8 @@ where | |
|
||
impl<S: Scope, T> Context<S, T> | ||
where | ||
T: Timestamp + Lattice, | ||
S::Timestamp: Lattice + Refines<T>, | ||
T: Timestamp + Lattice + Columnation, | ||
S::Timestamp: Lattice + Refines<T> + Columnation, | ||
{ | ||
/// Insert a collection bundle by an identifier. | ||
/// | ||
|
@@ -230,15 +230,15 @@ impl ShutdownToken { | |
#[derive(Clone)] | ||
pub enum SpecializedArrangement<S: Scope> | ||
where | ||
<S as ScopeParent>::Timestamp: Lattice, | ||
<S as ScopeParent>::Timestamp: Lattice + Columnation, | ||
{ | ||
RowUnit(KeyValArrangement<S, Row, ()>), | ||
RowRow(KeyValArrangement<S, Row, Row>), | ||
} | ||
|
||
impl<S: Scope> SpecializedArrangement<S> | ||
where | ||
<S as ScopeParent>::Timestamp: Lattice, | ||
<S as ScopeParent>::Timestamp: Lattice + Columnation, | ||
{ | ||
/// The scope of the underlying arrangement's stream. | ||
pub fn scope(&self) -> S { | ||
|
@@ -293,7 +293,7 @@ where | |
refuel: usize, | ||
) -> timely::dataflow::Stream<S, I::Item> | ||
where | ||
T: Timestamp + Lattice, | ||
T: Timestamp + Lattice + Columnation, | ||
<S as ScopeParent>::Timestamp: Lattice + Refines<T>, | ||
I: IntoIterator, | ||
I::Item: Data, | ||
|
@@ -329,7 +329,7 @@ where | |
|
||
impl<'a, S: Scope> SpecializedArrangement<Child<'a, S, S::Timestamp>> | ||
where | ||
<S as ScopeParent>::Timestamp: Lattice, | ||
<S as ScopeParent>::Timestamp: Lattice + Columnation, | ||
{ | ||
/// Extracts the underlying arrangement flavor from a region. | ||
pub fn leave_region(&self) -> SpecializedArrangement<S> { | ||
|
@@ -366,7 +366,7 @@ where | |
#[derive(Clone)] | ||
pub enum SpecializedArrangementImport<S: Scope, T = mz_repr::Timestamp> | ||
where | ||
T: Timestamp + Lattice, | ||
T: Timestamp + Lattice + Columnation, | ||
<S as ScopeParent>::Timestamp: Lattice + Refines<T>, | ||
{ | ||
RowUnit(KeyValArrangementImport<S, Row, (), T>), | ||
|
@@ -375,8 +375,8 @@ where | |
|
||
impl<S: Scope, T> SpecializedArrangementImport<S, T> | ||
where | ||
T: Timestamp + Lattice, | ||
<S as ScopeParent>::Timestamp: Lattice + Refines<T>, | ||
T: Timestamp + Lattice + Columnation, | ||
<S as ScopeParent>::Timestamp: Lattice + Refines<T> + Columnation, | ||
{ | ||
/// The scope of the underlying trace's stream. | ||
pub fn scope(&self) -> S { | ||
|
@@ -467,7 +467,7 @@ where | |
|
||
impl<'a, S: Scope, T> SpecializedArrangementImport<Child<'a, S, S::Timestamp>, T> | ||
where | ||
T: Timestamp + Lattice, | ||
T: Timestamp + Lattice + Columnation, | ||
<S as ScopeParent>::Timestamp: Lattice + Refines<T>, | ||
{ | ||
/// Extracts the underlying arrangement flavor from a region. | ||
|
@@ -487,8 +487,8 @@ where | |
#[derive(Clone)] | ||
pub enum ArrangementFlavor<S: Scope, T = mz_repr::Timestamp> | ||
where | ||
T: Timestamp + Lattice, | ||
S::Timestamp: Lattice + Refines<T>, | ||
T: Timestamp + Lattice + Columnation, | ||
S::Timestamp: Lattice + Refines<T> + Columnation, | ||
{ | ||
/// A dataflow-local arrangement. | ||
Local(SpecializedArrangement<S>, ErrArrangement<S>), | ||
|
@@ -505,8 +505,8 @@ where | |
|
||
impl<S: Scope, T> ArrangementFlavor<S, T> | ||
where | ||
T: Timestamp + Lattice, | ||
S::Timestamp: Lattice + Refines<T>, | ||
T: Timestamp + Lattice + Columnation, | ||
S::Timestamp: Lattice + Refines<T> + Columnation, | ||
{ | ||
/// Presents `self` as a stream of updates. | ||
/// | ||
|
@@ -582,8 +582,8 @@ where | |
} | ||
impl<S: Scope, T> ArrangementFlavor<S, T> | ||
where | ||
T: Timestamp + Lattice, | ||
S::Timestamp: Lattice + Refines<T>, | ||
T: Timestamp + Lattice + Columnation, | ||
S::Timestamp: Lattice + Refines<T> + Columnation, | ||
{ | ||
/// The scope containing the collection bundle. | ||
pub fn scope(&self) -> S { | ||
|
@@ -610,8 +610,8 @@ where | |
} | ||
impl<'a, S: Scope, T> ArrangementFlavor<Child<'a, S, S::Timestamp>, T> | ||
where | ||
T: Timestamp + Lattice, | ||
S::Timestamp: Lattice + Refines<T>, | ||
T: Timestamp + Lattice + Columnation, | ||
S::Timestamp: Lattice + Refines<T> + Columnation, | ||
{ | ||
/// Extracts the arrangement flavor from a region. | ||
pub fn leave_region(&self) -> ArrangementFlavor<S, T> { | ||
|
@@ -633,17 +633,17 @@ where | |
#[derive(Clone)] | ||
pub struct CollectionBundle<S: Scope, T = mz_repr::Timestamp> | ||
where | ||
T: Timestamp + Lattice, | ||
S::Timestamp: Lattice + Refines<T>, | ||
T: Timestamp + Lattice + Columnation, | ||
S::Timestamp: Lattice + Refines<T> + Columnation, | ||
Comment on lines
+636
to
+637
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAICT, even if we'd like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also needed:
|
||
{ | ||
pub collection: Option<(Collection<S, Row, Diff>, Collection<S, DataflowError, Diff>)>, | ||
pub arranged: BTreeMap<Vec<MirScalarExpr>, ArrangementFlavor<S, T>>, | ||
} | ||
|
||
impl<S: Scope, T: Lattice> CollectionBundle<S, T> | ||
where | ||
T: Timestamp + Lattice, | ||
S::Timestamp: Lattice + Refines<T>, | ||
T: Timestamp + Lattice + Columnation, | ||
S::Timestamp: Lattice + Refines<T> + Columnation, | ||
{ | ||
/// Construct a new collection bundle from update streams. | ||
pub fn from_collections( | ||
|
@@ -715,8 +715,8 @@ where | |
|
||
impl<'a, S: Scope, T> CollectionBundle<Child<'a, S, S::Timestamp>, T> | ||
where | ||
T: Timestamp + Lattice, | ||
S::Timestamp: Lattice + Refines<T>, | ||
T: Timestamp + Lattice + Columnation, | ||
S::Timestamp: Lattice + Refines<T> + Columnation, | ||
{ | ||
/// Extracts the collection bundle from a region. | ||
pub fn leave_region(&self) -> CollectionBundle<S, T> { | ||
|
@@ -734,10 +734,10 @@ where | |
} | ||
} | ||
|
||
impl<S: Scope, T: Lattice> CollectionBundle<S, T> | ||
impl<S: Scope, T> CollectionBundle<S, T> | ||
where | ||
T: Timestamp + Lattice, | ||
S::Timestamp: Lattice + Refines<T>, | ||
T: Timestamp + Lattice + Columnation, | ||
S::Timestamp: Lattice + Refines<T> + Columnation, | ||
{ | ||
/// Asserts that the arrangement for a specific key | ||
/// (or the raw collection for no key) exists, | ||
|
@@ -899,7 +899,7 @@ where | |
|
||
impl<S, T> CollectionBundle<S, T> | ||
where | ||
T: timely::progress::Timestamp + Lattice, | ||
T: timely::progress::Timestamp + Lattice + Columnation, | ||
S: Scope, | ||
S::Timestamp: | ||
Refines<T> + Lattice + timely::progress::Timestamp + crate::render::RenderTimestamp, | ||
|
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 was not completely clear to me whether these trait bounds are absolutely required here? We are forcing
CollectionBundle
to requireColumnation
on its timestamp types, but we could require these bounds only in the implementation includingensure_collections
?Another way to phrase the question more conceptually: Do we want to ensure
Columnation
for timestamp types in connection with arrangement usage only or across all contexts (arrangements, dataflow edges) in this PR? The difference is not large now in that the timestamps used in arrangements and the ones in dataflow edges are today the same, but changing the requirements expresses an opinion that they should at least share some more behavior than we've required so far.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.
Unfortunately, we need the bound on
CollectionBundle
becauseArrangementFlavor
needs it. We use bothT
andS::Timestamp
in the handles, so theColumnation
bound propagates everywhere.