Skip to content
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

Translate Eval Command #499

Merged
merged 3 commits into from
Jul 31, 2024
Merged

Conversation

LantaoJin
Copy link
Member

@LantaoJin LantaoJin commented Jul 30, 2024

Description

This PR translates the PPL eval command to Spark LogicalPlan by adding a Project with Alias expressions.

Issues Resolved

Resolves #429

Check List

  • Updated documentation (ppl-spark-integration/README.md)
  • Implemented unit tests
  • Implemented tests for combination with other commands
  • Commits are signed per the DCO using --signoff

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.

Signed-off-by: Lantao Jin <[email protected]>
public class Field extends UnresolvedExpression {
private final UnresolvedExpression field;
private final QualifiedName field;
Copy link
Member

Choose a reason for hiding this comment

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

are we always assuming the field will be a QualifiedName ?
are there cases it wont be able to resolve ?

Copy link
Member Author

@LantaoJin LantaoJin Jul 30, 2024

Choose a reason for hiding this comment

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

@@ -172,20 +172,6 @@ public UnresolvedExpression visitPercentileAggFunction(OpenSearchPPLParser.Perce
Collections.singletonList(new Argument("rank", (Literal) visit(ctx.value))));
}

@Override
Copy link
Member

Choose a reason for hiding this comment

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

why was this removed?

Copy link
Member Author

@LantaoJin LantaoJin Jul 30, 2024

Choose a reason for hiding this comment

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

It was removed in other PR which merged in main branch already. Since I started this work for a while so the code base in this PR has out of date I guess. So I manually removed this in my code base to avoid compile failure. Will merge main branch later.

Copy link
Member Author

Choose a reason for hiding this comment

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

After merging with main branch, this git diff is gone.

@LantaoJin LantaoJin marked this pull request as ready for review July 31, 2024 11:12
@YANG-DB YANG-DB merged commit 24d3b81 into opensearch-project:main Jul 31, 2024
4 checks passed
@YANG-DB YANG-DB added Lang:PPL Pipe Processing Language support backport 0.5 labels Aug 14, 2024
@opensearch-trigger-bot
Copy link

The backport to 0.5 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/opensearch-spark/backport-0.5 0.5
# Navigate to the new working tree
pushd ../.worktrees/opensearch-spark/backport-0.5
# Create a new branch
git switch --create backport/backport-499-to-0.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 24d3b81356a5dbbbfb3a22e43375c8dbc0aaf428
# Push it to GitHub
git push --set-upstream origin backport/backport-499-to-0.5
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/opensearch-spark/backport-0.5

Then, create a pull request where the base branch is 0.5 and the compare/head branch is backport/backport-499-to-0.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 0.5 Lang:PPL Pipe Processing Language support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]Add eval PPL command
3 participants