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

Support IN expression in PPL #823

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

LantaoJin
Copy link
Member

@LantaoJin LantaoJin commented Oct 28, 2024

Description

IN expression doesn't work in PPL:
| where state in ('California', 'Florida') throws NPE

This PR targets to support following syntax:

  • value IN (value_list)
  • value NOT IN (value_list)
  • NOT value IN (value_list) to compatible with opensearch-sql

Related Issues

Resolves #822

Check List

  • Updated documentation (docs/ppl-lang/README.md)
  • Implemented unit tests
  • Implemented tests for combination with other commands
  • New added source code should include a copyright header
  • 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.

@LantaoJin LantaoJin added Lang:PPL Pipe Processing Language support 0.6 labels Oct 28, 2024
@LantaoJin LantaoJin marked this pull request as ready for review October 28, 2024 11:24

test("test IN expr in eval") {
val frame = sql(s"""
| source = $testTable | eval in = state in ('California', 'New York') | fields in
Copy link
Member

@YANG-DB YANG-DB Oct 28, 2024

Choose a reason for hiding this comment

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

@LantaoJin - please add these examples to the eval doc as well

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@LantaoJin LantaoJin merged commit ce50567 into opensearch-project:main Oct 29, 2024
4 checks passed
kenrickyap pushed a commit to Bit-Quill/opensearch-spark that referenced this pull request Dec 11, 2024
* Support IN expression in PPL

Signed-off-by: Lantao Jin <[email protected]>

* add more example in eval doc

Signed-off-by: Lantao Jin <[email protected]>

---------

Signed-off-by: Lantao Jin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.6 Lang:PPL Pipe Processing Language support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] IN expression doesn't work in PPL
2 participants