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] fetch_size doesn't seem to work as described #241

Closed
peter-iron opened this issue Oct 22, 2021 · 3 comments
Closed

[BUG] fetch_size doesn't seem to work as described #241

peter-iron opened this issue Oct 22, 2021 · 3 comments
Labels
bug Something isn't working SQL

Comments

@peter-iron
Copy link

peter-iron commented Oct 22, 2021

Describe the bug
Hitting the /_opendistro/_sql endpoint with fetch_size in the body does not return a cursor field in the response even when it should. Providing a negative value does generate an error, so it is being provided and parsed properly and simply doesn't seem to have any impact on the return.

To Reproduce
Steps to reproduce the behavior:

  1. Construct a basic query that returns more than 2 results in your local instance
  2. using the application/json header: POST {"query": $query, "fetch_size": 2}
  3. Observe that you see receive the full, normal (>2 docs) response without a cursor

Expected behavior
I would expect to receive only 2 docs in response with a cursor entry that I could use in a subsequent POST {"cursor": $cursor} call to obtain more results from the same query.

Plugins
Please list all plugins currently enabled.

Host/Environment (please complete the following information):

  • OS: macOS
  • Version 11.6

Additional context

@chloe-zh
Copy link
Contributor

Hi @peter-iron thanks for reporting this issue, I tried to reproduce the error in my local cluster, but it is having proper behavior:

POST _plugins/_sql
{
  "fetch_size" : 5,
  "query": "SELECT Origin, Dest FROM opensearch_dashboards_sample_data_flights"
}

// result:
{
  "schema": [
    {
      "name": "Origin",
      "type": "keyword"
    },
    {
      "name": "Dest",
      "type": "keyword"
    }
  ],
  "cursor": "d:eyJhIjp7fSwicyI6IkZHbHVZMngxWkdWZlkyOXVkR1Y0ZEY5MWRXbGtEWEYxWlhKNVFXNWtSbVYwWTJnQkZuQXhVVU5KVjA1elVrdERkVmRNU2sweGVtNUhNM2NBQUFBQUFBQUFLeFpFVTJJeFpVaEplbEV4VjBOS2NsTjBZMEZvYlcxMyIsImMiOlt7Im5hbWUiOiJPcmlnaW4iLCJ0eXBlIjoia2V5d29yZCJ9LHsibmFtZSI6IkRlc3QiLCJ0eXBlIjoia2V5d29yZCJ9XSwiZiI6NSwiaSI6Im9wZW5zZWFyY2hfZGFzaGJvYXJkc19zYW1wbGVfZGF0YV9mbGlnaHRzIiwibCI6MTMwNTR9",
  "total": 13059,
  "datarows": [
    [
      "Frankfurt am Main Airport",
      "Sydney Kingsford Smith International Airport"
    ],
    [
      "Cape Town International Airport",
      "Venice Marco Polo Airport"
    ],
    [
      "Venice Marco Polo Airport",
      "Venice Marco Polo Airport"
    ],
    [
      "Naples International Airport",
      "Treviso-Sant'Angelo Airport"
    ],
    [
      "Licenciado Benito Juarez International Airport",
      "Xi'an Xianyang International Airport"
    ]
  ],
  "size": 5,
  "status": 200
}

Could you provide the version information of the OpenSearch/ODFE you are using?

@chloe-zh chloe-zh added the SQL label Oct 22, 2021
@peter-iron
Copy link
Author

I don't have admin access to the instance, so I'm inferring this:

  • ODFE 1.13.2
  • OpenSearch 1.0 because we are using OpenSearch on AWS, so I believe it is the only option per this page. The curl method for checking elasticsearch version does not seem to work for OpenSearch, but please let me know if there's another way to test.

@dai-chen
Copy link
Collaborator

Closing this since we're unable to reproduce. Feel free to reopen if more info you can provide. Thanks!

@dai-chen dai-chen moved this to Done in SQL Engineering Dec 12, 2022
dai-chen pushed a commit that referenced this issue Mar 15, 2023
* Added SIGNUM function to V2 engine (#241)

* Added SIGNUM function to V2 engine, updated documentation, added unit/IT tests

Signed-off-by: Matthew Wells <[email protected]>

* fixed merge mistake

Signed-off-by: Matthew Wells <[email protected]>

* fixed merging error

Signed-off-by: Matthew Wells <[email protected]>

---------

Signed-off-by: Matthew Wells <[email protected]>
opensearch-trigger-bot bot pushed a commit that referenced this issue Mar 15, 2023
* Added SIGNUM function to V2 engine (#241)

* Added SIGNUM function to V2 engine, updated documentation, added unit/IT tests

Signed-off-by: Matthew Wells <[email protected]>

* fixed merge mistake

Signed-off-by: Matthew Wells <[email protected]>

* fixed merging error

Signed-off-by: Matthew Wells <[email protected]>

---------

Signed-off-by: Matthew Wells <[email protected]>
(cherry picked from commit 6496692)
Yury-Fridlyand pushed a commit that referenced this issue Mar 17, 2023
* Added SIGNUM function to V2 engine (#241)

* Added SIGNUM function to V2 engine, updated documentation, added unit/IT tests

Signed-off-by: Matthew Wells <[email protected]>

* fixed merge mistake

Signed-off-by: Matthew Wells <[email protected]>

* fixed merging error

Signed-off-by: Matthew Wells <[email protected]>

---------

Signed-off-by: Matthew Wells <[email protected]>
(cherry picked from commit 6496692)

Co-authored-by: Matthew Wells <[email protected]>
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: Done
Development

No branches or pull requests

3 participants