Skip to content

Commit e19aa50

Browse files
committed
Fix metrics aggregation for native scan.
1 parent af84b73 commit e19aa50

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • native/core/src/execution/metrics

native/core/src/execution/metrics/utils.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,13 @@ pub(crate) fn to_native_metric_node(
6868
Some(metrics.aggregate_by_name())
6969
};
7070

71-
// add metrics
71+
// Aggregate metrics by name using DataFusion's aggregate_by_name(), which
72+
// correctly handles duplicate metric names (e.g. BaselineMetrics registered
73+
// by both FileStream and ParquetMorselizer on the same ExecutionPlanMetricsSet).
74+
// The additional_native_plans branch below already does this.
7275
node_metrics
7376
.unwrap_or_default()
77+
.aggregate_by_name()
7478
.iter()
7579
.map(|m| m.value())
7680
.map(|m| (m.name(), m.as_usize() as i64))

0 commit comments

Comments
 (0)