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

[BUG] PPL example on website not working #194

Closed
jonkerw85 opened this issue Aug 16, 2021 · 9 comments
Closed

[BUG] PPL example on website not working #194

jonkerw85 opened this issue Aug 16, 2021 · 9 comments
Assignees

Comments

@jonkerw85
Copy link

Describe the bug
The example on https://opensearch.org/docs/search-plugins/ppl/index/ is not working.

To Reproduce

  1. Go to the website https://opensearch.org/docs/search-plugins/ppl/index/
  2. Copy and paste the code in de Quick Start section to create the accounts index on your cluster
  3. In your cluster go to de Query Workbench, select PPL in de right corner
  4. Execute the PPL query that is suggested on https://opensearch.org/docs/search-plugins/ppl/index/

Expected behavior
Query result.

Plugins
Opensearch distro 7.10

Screenshots
afbeelding

Host/Environment (please complete the following information):

  • OS: AWS Elasticsearch
  • Version 7.10
@jonkerw85 jonkerw85 changed the title [BUG] [BUG] PPL example on website not working Aug 16, 2021
@CEHENKLE CEHENKLE transferred this issue from opensearch-project/OpenSearch Aug 24, 2021
@CEHENKLE
Copy link
Member

Transferring to the SQL team. If I've move this in error, please @ me and I'll move it back :)

@chloe-zh
Copy link
Contributor

chloe-zh commented Sep 4, 2021

Hi @wjonkerhulst , I tried the same steps in the documentation, but was not able to reproduce it. Could you try to execute in dev tools by using the following command to see what the error is returned?

POST _opendistro/_sql
{
  "query":"search source=accounts | where age > 18 | fields firstname, lastname"
}

@jonkerw85
Copy link
Author

@chloe-zh
afbeelding

@chloe-zh
Copy link
Contributor

chloe-zh commented Sep 6, 2021

My bad, the endpoint should be _opendistro/_ppl

@jonkerw85
Copy link
Author

@chloe-zh No problem. The PPL endpoint works.

afbeelding

@jonkerw85
Copy link
Author

@chloe-zh I think I have found the problem.

A single line query works:
afbeelding

But when I copy and paste the example it is multi-line and the query stops working.
afbeelding

@elfisher
Copy link
Contributor

I can confirm this is still an issue in 1.1. I cannot get multi-line to work in the query workbench, so that might be the issue. @chloe-zh do you know if that is a known issue?

@camAtGitHub
Copy link

camAtGitHub commented Nov 9, 2021

Hello @chloe-zh the issue is that 'Query Workbench' is not escaping quotes etc.
Attempting to run search source=accounts | where gender="F" results in: Events: no response, this query is not runnable.
However running search source=accounts | where gender=\"F\" returns the expected data.
The frustrating part is that documentation is either incorrect or an escaping bug has been introduced.

Thanks
(I'm running OS 1.1.0 docker build BTW)

@joshuali925
Copy link
Member

Hi, looks like there are two issues:

  1. line breaks were not handled correctly for PPL in workbench, causing multiline query to fail
  2. quotes are not properly escaped

Both will be fixed in #305, thanks for reporting them!

Yury-Fridlyand pushed a commit that referenced this issue Jan 10, 2023
* Add Day_Of_Month Function As An Alias Of DayOfMonth (#194)

Signed-off-by: GabeFernandez310 <[email protected]>
opensearch-trigger-bot bot pushed a commit that referenced this issue Jan 10, 2023
* Add Day_Of_Month Function As An Alias Of DayOfMonth (#194)

Signed-off-by: GabeFernandez310 <[email protected]>
(cherry picked from commit 1108379)
opensearch-trigger-bot bot pushed a commit that referenced this issue Jan 10, 2023
* Add Day_Of_Month Function As An Alias Of DayOfMonth (#194)

Signed-off-by: GabeFernandez310 <[email protected]>
(cherry picked from commit 1108379)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants