Skip to content

Conversation

@ykmr1224
Copy link
Collaborator

@ykmr1224 ykmr1224 commented Aug 28, 2025

Description

  • Pushdown earliest/latest aggregate functions to OpenSearch DSL
  • It actually push down arg_min / arg_max aggregate functions to top_hits aggregation query.
  • Fixed Spark SQL to use min_by / max_by (arg_min / arg_max is not available in Spark)

Related Issues

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • New PPL command checklist all confirmed.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff or -s.
  • 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.

@ykmr1224 ykmr1224 added enhancement New feature or request PPL Piped processing language calcite calcite migration releated pushdown pushdown related issues backport 2.19-dev labels Aug 29, 2025
Signed-off-by: Tomoyuki Morita <[email protected]>
Copy link
Member

@anasalkouz anasalkouz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we update our documentation with some use-case/examples?

@ykmr1224
Copy link
Collaborator Author

ykmr1224 commented Sep 2, 2025

Shall we update our documentation with some use-case/examples?

This is performance improvement by aggregate pushdown, and don't require doc update.

@LantaoJin LantaoJin merged commit 2f8f75d into opensearch-project:main Sep 3, 2025
23 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.19-dev failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.19-dev 2.19-dev
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.19-dev
# Create a new branch
git switch --create backport/backport-4166-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2f8f75d0a543d36003bcf440cae1208208c91390
# Push it to GitHub
git push --set-upstream origin backport/backport-4166-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-dev

Then, create a pull request where the base branch is 2.19-dev and the compare/head branch is backport/backport-4166-to-2.19-dev.

@ykmr1224
Copy link
Collaborator Author

ykmr1224 commented Sep 3, 2025

backport is blocked by backport of #4100

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.19-dev failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.19-dev 2.19-dev
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.19-dev
# Create a new branch
git switch --create backport/backport-4166-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2f8f75d0a543d36003bcf440cae1208208c91390
# Push it to GitHub
git push --set-upstream origin backport/backport-4166-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-dev

Then, create a pull request where the base branch is 2.19-dev and the compare/head branch is backport/backport-4166-to-2.19-dev.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.19-dev failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.19-dev 2.19-dev
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.19-dev
# Create a new branch
git switch --create backport/backport-4166-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2f8f75d0a543d36003bcf440cae1208208c91390
# Push it to GitHub
git push --set-upstream origin backport/backport-4166-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-dev

Then, create a pull request where the base branch is 2.19-dev and the compare/head branch is backport/backport-4166-to-2.19-dev.

ykmr1224 added a commit to ykmr1224/sql that referenced this pull request Sep 4, 2025
* Pushdown earliest/latest aggregate functions

Signed-off-by: Tomoyuki Morita <[email protected]>

* Fix spark sql

Signed-off-by: Tomoyuki Morita <[email protected]>

---------

Signed-off-by: Tomoyuki Morita <[email protected]>
ykmr1224 added a commit that referenced this pull request Sep 5, 2025
…) (#4225)

* Pushdown earliest/latest aggregate functions (#4166)

* Pushdown earliest/latest aggregate functions

Signed-off-by: Tomoyuki Morita <[email protected]>

* Fix spark sql

Signed-off-by: Tomoyuki Morita <[email protected]>

---------

Signed-off-by: Tomoyuki Morita <[email protected]>

* Fix for Java 11

Signed-off-by: Tomoyuki Morita <[email protected]>

* Fix for Java 11

Signed-off-by: Tomoyuki Morita <[email protected]>

---------

Signed-off-by: Tomoyuki Morita <[email protected]>
@LantaoJin LantaoJin added the backport-manually Filed a PR to backport manually. label Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.19-dev backport-failed backport-manually Filed a PR to backport manually. calcite calcite migration releated enhancement New feature or request PPL Piped processing language pushdown pushdown related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants