Skip to content

[Backport 2.19-dev] Support Sort pushdown (#3620) - #3836

Merged
LantaoJin merged 1 commit into
opensearch-project:2.19-devfrom
yuancu:backport/backport-3620-to-2.19-dev
Jul 1, 2025
Merged

LantaoJin merged 1 commit into
opensearch-project:2.19-devfrom
yuancu:backport/backport-3620-to-2.19-dev

Conversation

@yuancu

@yuancu yuancu commented Jul 1, 2025 •

Copy link
Copy Markdown
Collaborator

Description

Backport 3620 to 2.19-dev

Commit Message

  • Support Sort pushdown

Copy traits to logical index scan after pushing down sort

Allow pushing down multiple times

  • Merge multiple sort when occurs

  • Update trendline explain IT Additionally correct merge collation method

  • Re-index collations when pushing down projection

  • Support sort pushdown with aggregation when aggregated fields are not in sort by fields

  • Update explain_output.json

  • Support multi-sort Additionally remove sort when pushing down aggregation after adding collation by pushing down sort

  • Sanitize collations when sort can't be pushed down

  • Test explaining sort | stats avg

  • Test sort date

  • Chores: reorder util functions

  • Pass null direction when pushing down sort

  • Convert to keyword fields when sorting opensearch text fields

  • Test explaining sort after rename

  • Push down sort-then-limit, while only pushdown limit when limit-then-sort

  • Fix flaky test related to irregular number in some locales in datetime IT

  • Override existing collations where there are more than one order clauses


(cherry picked from commit 870b82c)

Related Issues

#3380

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

* Support Sort pushdown

Signed-off-by: Yuanchun Shen <[email protected]>

Copy traits to logical index scan after pushing down sort

Signed-off-by: Yuanchun Shen <[email protected]>

Allow pushing down multiple times

Signed-off-by: Yuanchun Shen <[email protected]>

* Merge multiple sort when occurs

Signed-off-by: Yuanchun Shen <[email protected]>

* Update trendline explain IT
Additionally correct merge collation method

Signed-off-by: Yuanchun Shen <[email protected]>

* Re-index collations when pushing down projection

Signed-off-by: Yuanchun Shen <[email protected]>

* Support sort pushdown with aggregation when aggregated fields are not in sort by fields

Signed-off-by: Yuanchun Shen <[email protected]>

* Update explain_output.json

Signed-off-by: Yuanchun Shen <[email protected]>

* Support multi-sort
Additionally remove sort when pushing down aggregation after adding collation by pushing down sort

Signed-off-by: Yuanchun Shen <[email protected]>

* Sanitize collations when sort can't be pushed down

Signed-off-by: Yuanchun Shen <[email protected]>

* Test explaining sort | stats avg

Signed-off-by: Yuanchun Shen <[email protected]>

* Test sort date

Signed-off-by: Yuanchun Shen <[email protected]>

* Chores: reorder util functions

Signed-off-by: Yuanchun Shen <[email protected]>

* Pass null direction when pushing down sort

Signed-off-by: Yuanchun Shen <[email protected]>

* Convert to keyword fields when sorting opensearch text fields

Signed-off-by: Yuanchun Shen <[email protected]>

* Test explaining sort after rename

Signed-off-by: Yuanchun Shen <[email protected]>

* Push down sort-then-limit, while only pushdown limit when limit-then-sort

Signed-off-by: Yuanchun Shen <[email protected]>

* Fix flaky test related to irregular number in some locales in datetime IT

Signed-off-by: Yuanchun Shen <[email protected]>

* Override existing collations where there are more than one order clauses

Signed-off-by: Yuanchun Shen <[email protected]>

---------

Signed-off-by: Yuanchun Shen <[email protected]>
(cherry picked from commit 870b82c)
@LantaoJin
LantaoJin enabled auto-merge (squash) July 1, 2025 07:58
@LantaoJin

Copy link
Copy Markdown
Member

@penghuo we don't have permission to merge. can u help to do that.

@LantaoJin
LantaoJin merged commit b9331be into opensearch-project:2.19-dev Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants