Skip to content

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

@dai-chen

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    SQLbugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions