Skip to content

[FEATURE] Push down sort on RexCall of monotonic #3990

Closed

Description

@qianheng-aws

Is your feature request related to a problem?
This query

source = test |  eval b = a + 1 | sort b

is equivalent to:

source = test | sort a | eval b = a + 1

since a + 1 is monotonic and so it's collation equals to a.

We can transform the query into the latter one and then has chance to push down its sort into scan.

What solution would you like?
A clear and concise description of what you want to happen.

What alternatives have you considered?
A clear and concise description of any alternative solutions or features you've considered.

Do you have any additional context?
The SortProjectTransposeRule in Calcite doesn't support transpose a sort on RexCall.

Activity

  1. added
    enhancement
    calcite
    on Aug 6, 2025
  2. qianheng-aws commented on Aug 6, 2025

    @qianheng-aws
    CollaboratorAuthor

    @songkant-aws Could you help implement this feature first?

  3. songkant-aws commented on Aug 6, 2025

    @songkant-aws
    Collaborator

    Looking

  4. added
    pushdown
    on Aug 25, 2025
  5. moved this from Not Started to Done in PPL Trackeron Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

calciteenhancementpushdownv3.3.0

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions