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

Cannot use the IN clause within the SUM method #2909

Open
idamerce opened this issue Aug 6, 2024 · 1 comment
Open

Cannot use the IN clause within the SUM method #2909

idamerce opened this issue Aug 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@idamerce
Copy link

idamerce commented Aug 6, 2024

Describe the bug
Hello everyone,
Is there anyone here familiar with using SQL on OpenSearch? We are encountering errors when running our queries and would greatly appreciate any assistance or insights you could provide.

To Reproduce
Specifically, we are facing issues with queries of type :

this works:

SELECT count(*) AS fps_count
FROM `my-alias-db`
WHERE status IN ('AA','BB')

but this does not (needed for creating new metrics in superset)

SELECT SUM(CASE WHEN status IN ('AA', 'BB') THEN 1 ELSE 0 END) AS status_sum
FROM 'my-alias-db'

Expected behavior
I'm expecting to have same results but I'm getting this error:
odelasticsearch error: Error (NullPointerException): {'error': {'reason': 'Invalid SQL query', 'details': '', 'type': 'NullPointerException'}, 'status': 400}

Host/Environment (please complete the following information):

  • OS: [ opensearch on aws]

Additional context
need to use my query for creating new metrics on superset

@idamerce idamerce added bug Something isn't working untriaged labels Aug 6, 2024
@idamerce idamerce changed the title [BUG][Component Name] Cannot use the IN clause within the SUM method Aug 6, 2024
@prudhvigodithi prudhvigodithi transferred this issue from opensearch-project/opensearch-devops Aug 6, 2024
@dblock dblock removed the untriaged label Aug 26, 2024
@dblock
Copy link
Member

dblock commented Aug 26, 2024

[Catch All Triage - 1, 2, 3, 4, 5]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants