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] Queries with a LIMIT clause and those without it return different results. #3121

Open
penghuo opened this issue Oct 25, 2024 · 0 comments
Assignees
Labels
bug Something isn't working data-correctness

Comments

@penghuo
Copy link
Collaborator

penghuo commented Oct 25, 2024

What is the bug?
Queries with a LIMIT clause and those without it return different results.

How can one reproduce the bug?

###
POST {{baseUrl}}/_plugins/_sql/_explain
Content-Type: application/x-ndjson

{
  "query": "SELECT Origin, Dest FROM (SELECT * FROM opensearch_dashboards_sample_data_flights WHERE AvgTicketPrice > 100 GROUP BY Origin, Dest, AvgTicketPrice) AS flights WHERE AvgTicketPrice < 1000 ORDER BY AvgTicketPrice"
}

## Return 20 rows

###
POST {{baseUrl}}/_plugins/_sql/_explain
Content-Type: application/x-ndjson

{
  "query": "SELECT Origin, Dest FROM (SELECT * FROM opensearch_dashboards_sample_data_flights WHERE AvgTicketPrice > 100 GROUP BY Origin, Dest, AvgTicketPrice) AS flights WHERE AvgTicketPrice < 1000 ORDER BY AvgTicketPrice LIMIT 30"
}

### Return 19 rows, missing row is
[
  "Abu Dhabi International Airport",
  "Albuquerque International Sunport Airport"
]

What is your host/environment?

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

No branches or pull requests

1 participant