Skip to content

CometIcebergNativeScanExec: propagate outputOrdering from originalPlan instead of hardcoding Nil #4367

@Shekharrajak

Description

@Shekharrajak

What is the problem the feature request solves?

CometIcebergNativeScanExec.scala hardcodes outputOrdering to Nil:

override lazy val outputOrdering: Seq[SortOrder] = Nil

Ref apache/iceberg#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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions