andygrove opened a new issue, #6975: URL: https://github.com/apache/datafusion-comet/issues/6975
### What is the problem the feature request solves? `CometFilterExec` and `CometProjectionExec` are renamed copies of the same wrapper: - [operators/src/filter.rs#L67-L238](https://github.com/apache/datafusion-comet/blob/7d8d9b1544b734c85a93cca2cc9d5380ad70accd/native/operators/src/filter.rs#L67-L238) - [operators/src/projection.rs#L63-L237](https://github.com/apache/datafusion-comet/blob/7d8d9b1544b734c85a93cca2cc9d5380ad70accd/native/operators/src/projection.rs#L63-L237) Each holds a DataFusion exec plus a stable `ExecutionPlanMetricsSet`, with identical `replace_input`, `with_execution_input`, `replace_children`, `execute` (which registers fresh metrics on the stable set) and about 15 pure delegating `ExecutionPlan` methods. Apart from type names and doc comments, the only differences are the filter-only `predicate()`/`has_projection()` accessors and that the projection wrapper forwards `benefits_from_input_partitioning` while the filter wrapper does not. That last difference shows how the copies drift: whenever DataFusion adds or changes an `ExecutionPlan` method, each wrapper has to be updated by hand, and the next operator that needs stable metrics will copy this a third time. The metric-identity logic in `execute` is subtle and should live in one place. ### Describe the potential solution - Introduce a generic wrapper in `native/operators` (e.g. `MetricOwningExec<T: ExecutionPlan>`, or a small macro) that implements `replace_input`, `with_execution_input`, `replace_children`, `execute` and `metrics` once and delegates the remaining `ExecutionPlan` methods. - Make `CometFilterExec`/`CometProjectionExec` thin newtypes or aliases that only add their specific accessors. - Decide explicitly whether `benefits_from_input_partitioning` should be forwarded for filter too. ### Additional context Line references are pinned to commit 7d8d9b1544b7. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
