Skip to content

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

@qianheng-aws

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.

Metadata

Metadata

Assignees

Labels

calcitecalcite migration releatedenhancementNew feature or requestpushdownpushdown related issuesv3.3.0

Type

No type

Projects

Status

New

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions