apache / apache/datafusion-comet

CometIcebergNativeScanExec: propagate outputOrdering from originalPlan instead of hardcoding Nil

Open
#4,367 0 comments 0 reactions 0 assignees View on GitHub
area:scan enhancement priority:medium
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.