Skip to content

[BUG] Non-paginated results returned silently if query not supported by cursor #78

Closed as not planned

Description

@dai-chen

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)

Activity

  1. added
    bug
    on May 20, 2021
  2. 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[/+] on May 20, 2021
  3. 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[/+] on May 20, 2021
  4. 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[/+] on May 20, 2021
  5. acarbonetto commented on Jun 19, 2023

    @acarbonetto
    Collaborator

    this should get fixed by #656

  6. Yury-Fridlyand commented on Jun 20, 2023

    @Yury-Fridlyand
    Collaborator

    Will be fixed by #1759

  7. Yury-Fridlyand commented on Jun 22, 2023

    @Yury-Fridlyand
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    SQLbug

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions