-
Notifications
You must be signed in to change notification settings - Fork 180
Add EARLIEST/LATEST aggregate functions for PPL #4100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f3299c4 to
a820a9c
Compare
|
Checking doctest failure. |
ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java
Show resolved
Hide resolved
ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java
Outdated
Show resolved
Hide resolved
ppl/src/test/java/org/opensearch/sql/ppl/calcite/CalcitePPLEarliestLatestTest.java
Outdated
Show resolved
Hide resolved
ppl/src/test/java/org/opensearch/sql/ppl/calcite/CalcitePPLEarliestLatestTest.java
Outdated
Show resolved
Hide resolved
integ-test/src/test/java/org/opensearch/sql/ppl/NewAddedCommandsIT.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/opensearch/sql/calcite/udf/udaf/MaxByAggFunction.java
Outdated
Show resolved
Hide resolved
dai-chen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes!
| verifyResult(root, expectedResult); | ||
|
|
||
| String expectedSparkSql = | ||
| "SELECT ARG_MIN(`message`, `@timestamp`) `earliest_message`\n" + "FROM `POST`.`LOGS`"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is bug. I only see min/max_by in SparkSQL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I will address this in the next PR.
|
The backport to 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-4100-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e2a1132018b260017e0c387122ef6d8523726c94
# Push it to GitHub
git push --set-upstream origin backport/backport-4100-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-devThen, create a pull request where the |
|
The backport to 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-4100-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e2a1132018b260017e0c387122ef6d8523726c94
# Push it to GitHub
git push --set-upstream origin backport/backport-4100-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-devThen, create a pull request where the |
|
The backport to 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-4100-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e2a1132018b260017e0c387122ef6d8523726c94
# Push it to GitHub
git push --set-upstream origin backport/backport-4100-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-devThen, create a pull request where the |
|
backport blocker: #4094 |
|
The backport to 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-4100-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e2a1132018b260017e0c387122ef6d8523726c94
# Push it to GitHub
git push --set-upstream origin backport/backport-4100-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-devThen, create a pull request where the |
|
The backport to 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-4100-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e2a1132018b260017e0c387122ef6d8523726c94
# Push it to GitHub
git push --set-upstream origin backport/backport-4100-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-devThen, create a pull request where the |
) * Add earliest/latest aggregate function to PPL Signed-off-by: Tomoyuki Morita <[email protected]> * Reformat Signed-off-by: Tomoyuki Morita <[email protected]> * Add IT Signed-off-by: Tomoyuki Morita <[email protected]> * Fix integ test Signed-off-by: Tomoyuki Morita <[email protected]> * Use ARG_MAX and ARG_MIN instead Signed-off-by: Tomoyuki Morita <[email protected]> * Revert comment deletion Signed-off-by: Tomoyuki Morita <[email protected]> * Remove min_by and max_by Signed-off-by: Tomoyuki Morita <[email protected]> * Update doc Signed-off-by: Tomoyuki Morita <[email protected]> * Fix tests Signed-off-by: Tomoyuki Morita <[email protected]> * Fix tests Signed-off-by: Tomoyuki Morita <[email protected]> * Fix tests Signed-off-by: Tomoyuki Morita <[email protected]> * Fit IT Signed-off-by: Tomoyuki Morita <[email protected]> * Fix doctest Signed-off-by: Tomoyuki Morita <[email protected]> * Fix doctest Signed-off-by: Tomoyuki Morita <[email protected]> * Remove unneeded test Signed-off-by: Tomoyuki Morita <[email protected]> * Delete unneeded files Signed-off-by: Tomoyuki Morita <[email protected]> * Minor fix Signed-off-by: Tomoyuki Morita <[email protected]> * Fix issue caused by conflict Signed-off-by: Tomoyuki Morita <[email protected]> * reformat Signed-off-by: Tomoyuki Morita <[email protected]> * Fix doctest issue Signed-off-by: Tomoyuki Morita <[email protected]> * Minor fix Signed-off-by: Tomoyuki Morita <[email protected]> * Fix tests Signed-off-by: Tomoyuki Morita <[email protected]> * Fix test_docs Signed-off-by: Tomoyuki Morita <[email protected]> * Update test_docs.py Signed-off-by: Tomoyuki Morita <[email protected]> * Refactor test_docs.py and fix Signed-off-by: Tomoyuki Morita <[email protected]> * Fix issues caused by merge Signed-off-by: Tomoyuki Morita <[email protected]> --------- Signed-off-by: Tomoyuki Morita <[email protected]> Signed-off-by: Tomoyuki MORITA <[email protected]> Signed-off-by: Tomoyuki Morita <[email protected]>
) * Add earliest/latest aggregate function to PPL Signed-off-by: Tomoyuki Morita <[email protected]> * Reformat Signed-off-by: Tomoyuki Morita <[email protected]> * Add IT Signed-off-by: Tomoyuki Morita <[email protected]> * Fix integ test Signed-off-by: Tomoyuki Morita <[email protected]> * Use ARG_MAX and ARG_MIN instead Signed-off-by: Tomoyuki Morita <[email protected]> * Revert comment deletion Signed-off-by: Tomoyuki Morita <[email protected]> * Remove min_by and max_by Signed-off-by: Tomoyuki Morita <[email protected]> * Update doc Signed-off-by: Tomoyuki Morita <[email protected]> * Fix tests Signed-off-by: Tomoyuki Morita <[email protected]> * Fix tests Signed-off-by: Tomoyuki Morita <[email protected]> * Fix tests Signed-off-by: Tomoyuki Morita <[email protected]> * Fit IT Signed-off-by: Tomoyuki Morita <[email protected]> * Fix doctest Signed-off-by: Tomoyuki Morita <[email protected]> * Fix doctest Signed-off-by: Tomoyuki Morita <[email protected]> * Remove unneeded test Signed-off-by: Tomoyuki Morita <[email protected]> * Delete unneeded files Signed-off-by: Tomoyuki Morita <[email protected]> * Minor fix Signed-off-by: Tomoyuki Morita <[email protected]> * Fix issue caused by conflict Signed-off-by: Tomoyuki Morita <[email protected]> * reformat Signed-off-by: Tomoyuki Morita <[email protected]> * Fix doctest issue Signed-off-by: Tomoyuki Morita <[email protected]> * Minor fix Signed-off-by: Tomoyuki Morita <[email protected]> * Fix tests Signed-off-by: Tomoyuki Morita <[email protected]> * Fix test_docs Signed-off-by: Tomoyuki Morita <[email protected]> * Update test_docs.py Signed-off-by: Tomoyuki Morita <[email protected]> * Refactor test_docs.py and fix Signed-off-by: Tomoyuki Morita <[email protected]> * Fix issues caused by merge Signed-off-by: Tomoyuki Morita <[email protected]> --------- Signed-off-by: Tomoyuki Morita <[email protected]> Signed-off-by: Tomoyuki MORITA <[email protected]> Signed-off-by: Tomoyuki Morita <[email protected]>
* Add earliest/latest aggregate function to PPL * Reformat * Add IT * Fix integ test * Use ARG_MAX and ARG_MIN instead * Revert comment deletion * Remove min_by and max_by * Update doc * Fix tests * Fix tests * Fix tests * Fit IT * Fix doctest * Fix doctest * Remove unneeded test * Delete unneeded files * Minor fix * Fix issue caused by conflict * reformat * Fix doctest issue * Minor fix * Fix tests * Fix test_docs * Update test_docs.py * Refactor test_docs.py and fix * Fix issues caused by merge --------- Signed-off-by: Tomoyuki Morita <[email protected]> Signed-off-by: Tomoyuki MORITA <[email protected]>
Description
EARLIESTandLATESTaggregate functions for PPL using a ARG_MIN/ARG_MAX.@timestampfield to decide the earliest/latest by default.Usage
Related Issues
earliest/latestaggregation function support #3639Check List
--signoffor-s.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.