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] ODBC driver not properly paging #16

Open
andybeaulieu opened this issue Dec 6, 2021 · 4 comments
Open

[BUG] ODBC driver not properly paging #16

andybeaulieu opened this issue Dec 6, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@andybeaulieu
Copy link

andybeaulieu commented Dec 6, 2021

Describe the bug
When using the ODBC driver from some SQL clients, only the first 200 rows are retrieved by default. Normally we would use a "LIMIT" clause to get more than 200 rows, but LIMIT is not supported by all SQL clients. We can manually increase the cluster opendistro.query.size_limit and the index.max_result_window settings, but this has significant memory overhead.

Can the ODBC driver support an efficient paging mechanism for these?

To Reproduce
Steps to reproduce the behavior:

  1. In SQL Server (or a different SQL client tool), add a linked server to the OpenSearch ODBC DSN:
    EXEC sp_addlinkedserver
    @server = N'OpenSearch',
    @srvproduct = N'',
    @Provider = N'MSDASQL',
    @datasrc = N'OpenSearch SQL ODBC DSN';

  2. try to query the Linked Server using SQL (ensure the OpenSearch index has more than 200 rows)
    select top 1000 * from [OpenSearch]...[myopensearchindex]

What happens
only the first 200 rows are retrieved. We can force more rows by changing the cluster's opendistro.query.size_limit and each index's index.max_result_window --- but that is not optimal for memory.

Expected behavior
The ODBC driver should implement proper paging to get the data down to the client. Maybe it could honor the T-SQL "top" syntax instead of a "LIMIT" clause?

@andybeaulieu andybeaulieu added the bug Something isn't working label Dec 6, 2021
@dai-chen dai-chen transferred this issue from opensearch-project/sql Dec 14, 2022
@dratasich
Copy link

Any news? Any solution for this issue? How can we get all results, e.g., for a PowerBI dashboard?

@Yury-Fridlyand
Copy link
Collaborator

Hi @dratasich @andybeaulieu,
Sorry for the late response, I got unsubscribed from all ODBC tickets because they were moved to another repo.

I tested ODBC driver with a sample application and it supports pagination/cursor.
Unfortunately, OpenSearch SQL plugin does not support TOP option in SELECT clause. You are welcome to open a ticket - client's/customer's issues are more valued.

@Yury-Fridlyand
Copy link
Collaborator

@dratasich @andybeaulieu,
I found an incompatibility between ODBC driver and PBI connector - the connector can't set the fetch_size parameter.
I made a private build for you of the PBI connector which sets fetch_size to 10 for all queries. Try using it and post your feedback:
OpenSearchProject#16.zip

@dratasich
Copy link

Thanks @Yury-Fridlyand - we will try and come back to you!

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

No branches or pull requests

3 participants