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

Allow backtick around fields in sort cmd #1688

Merged
merged 4 commits into from
May 31, 2023

Conversation

joshuali925
Copy link
Member

Description

currently this doesn't work

❯ curl -X POST -k -H 'Content-Type: application/json' localhost:9200/_plugins/_ppl -d '{"query":"source=accounts | sort `age`"}'
{
  "error": {
    "reason": "Invalid Query",
    "details": "can't resolve Symbol(namespace=FIELD_NAME, name=`age`) in type env",
    "type": "SemanticCheckException"
  },
  "status": 400
}%

The PR will add support for fields in backticks so sort behavior is consistent with other commands.
This PR also fixes some build issues

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • 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: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
@joshuali925 joshuali925 force-pushed the allow-backtick-in-sort branch from 52711d0 to c8d1737 Compare May 30, 2023 23:15
@codecov
Copy link

codecov bot commented May 30, 2023

Codecov Report

Merging #1688 (2978737) into main (57ce303) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##               main    #1688   +/-   ##
=========================================
  Coverage     97.27%   97.27%           
  Complexity     4330     4330           
=========================================
  Files           388      388           
  Lines         10807    10807           
  Branches        761      761           
=========================================
  Hits          10513    10513           
  Misses          287      287           
  Partials          7        7           
Flag Coverage Δ
sql-engine 97.27% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...pensearch/sql/ppl/parser/AstExpressionBuilder.java 100.00% <100.00%> (ø)

Signed-off-by: Joshua Li <joshuali925@gmail.com>
Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@dai-chen dai-chen added the bug Something isn't working label May 31, 2023
@dai-chen dai-chen merged commit 691012d into opensearch-project:main May 31, 2023
@dai-chen dai-chen added the PPL Piped processing language label May 31, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 31, 2023
* Allow backtick around fields in sort cmd

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Add test

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Update test setup

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* revert ignoring sql-cli repo if exists

Signed-off-by: Joshua Li <joshuali925@gmail.com>

---------

Signed-off-by: Joshua Li <joshuali925@gmail.com>
(cherry picked from commit 691012d)
dai-chen pushed a commit that referenced this pull request May 31, 2023
* Allow backtick around fields in sort cmd

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Add test

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Update test setup

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* revert ignoring sql-cli repo if exists

Signed-off-by: Joshua Li <joshuali925@gmail.com>

---------

Signed-off-by: Joshua Li <joshuali925@gmail.com>
(cherry picked from commit 691012d)

Co-authored-by: Joshua Li <joshuali925@gmail.com>
MitchellGale pushed a commit to Bit-Quill/opensearch-project-sql that referenced this pull request Jun 12, 2023
* Allow backtick around fields in sort cmd

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Add test

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Update test setup

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* revert ignoring sql-cli repo if exists

Signed-off-by: Joshua Li <joshuali925@gmail.com>

---------

Signed-off-by: Joshua Li <joshuali925@gmail.com>
MitchellGale pushed a commit to Bit-Quill/opensearch-project-sql that referenced this pull request Jun 12, 2023
* Allow backtick around fields in sort cmd

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Add test

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Update test setup

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* revert ignoring sql-cli repo if exists

Signed-off-by: Joshua Li <joshuali925@gmail.com>

---------

Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x bug Something isn't working PPL Piped processing language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants