apache / apache/iceberg-rust

Report DataFusion operator metrics in IcebergTableScan

Open
#2,364 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
1.4k
Forks
567
Avg merge
2d 2h
Merged PRs (30d)
93

Description

### Is your feature request related to a problem or challenge?

`IcebergTableScan` does not implement `ExecutionPlan::metrics()`, so `EXPLAIN ANALYZE` shows an empty `metrics=[]` on the scan line while every other operator in the plan reports its cost.

This makes query profiling against Iceberg tables blind on the scan, and prevents quantifying optimizations that touch the scan.

**Reproducer:** `EXPLAIN ANALYZE SELECT * FROM t WHERE foo = 1`:

```
CoalesceBatchesExec: ..., metrics=[output_rows=1, elapsed_compute=19µs]
FilterExec: foo@0 = 1, metrics=[output_rows=1, elapsed_compute=90µs]
RepartitionExec: ..., metrics=[fetch_time=4.4ms, ...]
IcebergTableScan predicate:[foo = 1], metrics=[] <-- empty
```

### Describe the solution you'd like

Wire `BaselineMetrics` + `ExecutionPlanMetricsSet` into `IcebergTableScan`, same pattern as `ParquetExec`.

Scope limited to the two default metrics (`elapsed_compute`, `output_rows`). `bytes_scanned` is a natural follow-up once #2349 lands: its `ScanMetrics` counter can be exposed as a custom DataFusion metric in a separate PR.

### Willingness to contribute

I can contribute to this feature independently

Contributor guide

Open the contributing guide

Research direction

Start at IcebergTableScan and compare the metrics pattern used by ParquetExec, focusing on BaselineMetrics and ExecutionPlanMetricsSet. Wire the two requested default metrics, elapsed_compute and output_rows, then run the EXPLAIN ANALYZE reproducer to confirm the scan reports metrics without adding bytes_scanned.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.