Skip to content

Commit

Permalink
fix(meta): display distinct dedup tables in dashboard (#7948)
Browse files Browse the repository at this point in the history
As title.

Approved-By: st1page
Approved-By: BugenZhao
  • Loading branch information
stdrc authored Feb 15, 2023
1 parent 2541ec6 commit ff6db4a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,14 @@ impl StreamNode for StreamGlobalSimpleAgg {
),
distinct_dedup_tables: distinct_dedup_tables
.into_iter()
.map(|(key_idx, table)| (key_idx as u32, table.to_internal_table_prost()))
.map(|(key_idx, table)| {
(
key_idx as u32,
table
.with_id(state.gen_table_id_wrapped())
.to_internal_table_prost(),
)
})
.collect(),
})
}
Expand Down
9 changes: 8 additions & 1 deletion src/frontend/src/optimizer/plan_node/stream_hash_agg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,14 @@ impl StreamNode for StreamHashAgg {
),
distinct_dedup_tables: distinct_dedup_tables
.into_iter()
.map(|(key_idx, table)| (key_idx as u32, table.to_internal_table_prost()))
.map(|(key_idx, table)| {
(
key_idx as u32,
table
.with_id(state.gen_table_id_wrapped())
.to_internal_table_prost(),
)
})
.collect(),
})
}
Expand Down
11 changes: 10 additions & 1 deletion src/meta/src/stream/stream_graph/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ where
/// Visit the internal tables of a [`StreamFragment`].
pub(super) fn visit_internal_tables<F>(fragment: &mut StreamFragment, mut f: F)
where
F: FnMut(&mut Table, &'static str),
F: FnMut(&mut Table, &str),
{
macro_rules! always {
($table:expr, $name:expr) => {{
Expand Down Expand Up @@ -93,6 +93,9 @@ where
always!(s.table, "HashAgg");
}
}
for (distinct_col, dedup_table) in &mut node.distinct_dedup_tables {
f(dedup_table, &format!("HashAggDedupForCol{}", distinct_col));
}
}
NodeBody::GlobalSimpleAgg(node) => {
assert_eq!(node.agg_call_states.len(), node.agg_calls.len());
Expand All @@ -104,6 +107,12 @@ where
always!(s.table, "GlobalSimpleAgg");
}
}
for (distinct_col, dedup_table) in &mut node.distinct_dedup_tables {
f(
dedup_table,
&format!("GlobalSimpleAggDedupForCol{}", distinct_col),
);
}
}

// Top-N
Expand Down

0 comments on commit ff6db4a

Please sign in to comment.