Deterministic IDs for ExecutionPlan
- Dominant language
- Rust
- Stars
- 9.3k
- Forks
- 2.4k
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 344
Description
### Is your feature request related to a problem or challenge?
Currently execution plans do not have an id associated with them this makes comparison of metrics across the runs. Additionally we would like to add a UI to our project to display the metrics as well snapshot our plans.
Looking at the code, it seems to me that the the `physical_planner` [does record the node index](https://github.com/apache/datafusion/blob/main/datafusion/core/src/physical_planner.rs#L555C17-L555C30) which is not [passed down to `map_logical_node_to_physical`](https://github.com/apache/datafusion/blob/main/datafusion/core/src/physical_planner.rs#L697-L702).
### Describe the solution you'd like
It would quite trivial to pass the node index to ExecutionPlan creation step and add additional field `operator_id` `plan_id` to ExecutionPlanProperties.
### Describe alternatives you've considered
We looked into using `task_id` field, but it always seems to be set to None.
### Additional context
_No response_
Contributor guide
Research direction
Start in datafusion/core/src/physical_planner.rs at the physical_planner node-index handling and map_logical_node_to_physical. Trace how ExecutionPlan instances receive ExecutionPlanProperties and determine the design for stable plan and operator IDs. Done means execution plans expose deterministic IDs that support comparing metrics across runs and snapshotting plans.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100