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] Non-paginated results returned silently if query not supported by cursor #78

Open
dai-chen opened this issue May 20, 2021 · 3 comments
Labels
bug Something isn't working SQL

Comments

@dai-chen
Copy link
Collaborator

dai-chen commented May 20, 2021

Describe the bug
If the query is not supported by cursor to paginate, such as GROUP BY, full result set is returned silently instead of error with clear message.

To Reproduce

  1. Create any index
  2. Enable cursor setting manually or merge PR Remove cursor enabling and fetch size setting #75
  3. Run a GROUP BY query
  4. See the empty response as below
curl -H 'Content-Type: application/json' -XPOST "http://localhost:9200/_plugins/_sql" -d'
{
   "query": "SELECT state.keyword, count(1) FROM accounts GROUP BY state",
   "fetch_size": 10
}'
{
  "schema": [
    {
      "name": "state.keyword",
      "type": "double"
    },
    {
      "name": "COUNT(1)",
      "type": "double"
    }
  ],
  "total": 51,
  "datarows": [
    [
      "TX",
      0
    ],
    [
      "MD",
      0
    ],
    [
      "ID",
    ......
  ],
  "size": 51,
  "status": 200
}

Expected behavior
Expect an error thrown with clear message saying that the type of query is not supported for pagination yet.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS] Mac
  • Version [e.g. 22] OpenSearch beta-1 (or current develop branch)
@dai-chen dai-chen added bug Something isn't working SQL labels May 20, 2021
@dai-chen dai-chen changed the title [BUG] Empty response returned if query is not supported by cursor [BUG] Empty or non-paginated response returned if query not supported by cursor May 20, 2021
@dai-chen dai-chen changed the title [BUG] Empty or non-paginated response returned if query not supported by cursor [BUG] Non-paginated response returned silently if query not supported by cursor May 20, 2021
@dai-chen dai-chen changed the title [BUG] Non-paginated response returned silently if query not supported by cursor [BUG] Non-paginated results returned silently if query not supported by cursor May 20, 2021
@acarbonetto
Copy link
Collaborator

this should get fixed by #656

@Yury-Fridlyand
Copy link
Collaborator

Will be fixed by #1759

@Yury-Fridlyand
Copy link
Collaborator

Or converted to a feature in #1765

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SQL
Projects
No open projects
Status: No status
Development

No branches or pull requests

3 participants