Skip to content

Commit f7169df

Browse files
committed
feat: add join operation categorization to EnhancedMemoryReport
1 parent eda77eb commit f7169df

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • datafusion/core/src/execution/context

datafusion/core/src/execution/context/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ impl EnhancedMemoryReport {
127127
"Data Input"
128128
} else if name.contains("filter") {
129129
"Filtering"
130+
} else if name.contains("join") {
131+
"Join Operation"
130132
} else if name.contains("aggregate") {
131133
"Aggregation"
132134
} else if name.contains("sort") {
@@ -257,13 +259,13 @@ mod enhanced_memory_report_tests {
257259
("unknownOp", 5),
258260
];
259261
let raw = entries
260-
.into_iter()
261-
.map(|(k, v)| (k.to_string(), v))
262+
.iter()
263+
.map(|(k, v)| (k.to_string(), *v))
262264
.collect::<HashMap<_, _>>();
263265
let report = EnhancedMemoryReport::from_raw_report(raw.clone());
264266
assert_eq!(
265267
report.total_memory,
266-
entries.iter().map(|(_, v)| *v as usize).sum()
268+
entries.iter().map(|(_, v)| *v as usize).sum::<usize>()
267269
);
268270
assert_eq!(report.peak_memory, 90);
269271
let cats = &report.categorized_operators;
@@ -2237,9 +2239,7 @@ mod tests {
22372239
use async_trait::async_trait;
22382240
use datafusion_expr::planner::TypePlanner;
22392241

2240-
use super::EnhancedMemoryReport;
22412242
use sqlparser::ast;
2242-
use std::collections::HashMap;
22432243
use tempfile::TempDir;
22442244

22452245
#[test]

0 commit comments

Comments
 (0)