apache / apache/datafusion-comet
CometIcebergNativeScanExec: propagate outputOrdering from originalPlan instead of hardcoding Nil
- Dominant language
- Scala
- Stars
- 1.3k
- Forks
- 373
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 190
Description
### What is the problem the feature request solves?
CometIcebergNativeScanExec.scala hardcodes outputOrdering to Nil:
```
override lazy val outputOrdering: Seq[SortOrder] = Nil
```
Ref https://github.com/apache/iceberg/issues/16430
We can update it to :
```
override lazy val outputOrdering: Seq[SortOrder] =
if (originalPlan != null) originalPlan.outputOrdering else Nil
```
originalPlan is the wrapped BatchScanExec. Once Iceberg implements SupportsReportOrdering, BatchScanExec.outputOrdering returns the correct sort order and Comet inherits it
This wil eliminate CometSortExec above Iceberg native scans for sort-merge joins .
### Describe the potential solution
_No response_
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.