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] JDBC driver forces SQL plugin to use the v1 engine #23

Open
MaxKsyunz opened this issue Oct 8, 2022 · 4 comments
Open

[BUG] JDBC driver forces SQL plugin to use the v1 engine #23

MaxKsyunz opened this issue Oct 8, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@MaxKsyunz
Copy link
Collaborator

What is the bug?
Users of the JDBC driver cannot make use of new SQL plugin features because queries sent by the JDBC driver by-pass v2 engine and are always executed by the v1 engine.

What is the expected behavior?
Queries sent by JDBC driver to be attempted by v2 engine first and only fallback to v1 engine if it uses unsupported SQL features.

What is your host/environment?

  • OpenSearch 2.4.0.0
  • JDBC Driver 1.1.0.1

Do you have any additional context?
When JDBC executes a statement, it sets fetch_size parameter to 100. This fails this check here.

@MaxKsyunz MaxKsyunz added the bug Something isn't working label Oct 8, 2022
@MaxKsyunz
Copy link
Collaborator Author

I haven't found where this happens, yet when I create a connection fetchSize is 0, but when createStatement is called, the query it generates sets fetch_size to 100.

@MaxKsyunz
Copy link
Collaborator Author

I found that the same query works fine in DbVisualizer but in IntelliJ Database tool, fetch_size ends up being 100.

The culprit is probably Statement.setFetchSize override. It's a JDBC method that the client can use to control how many rows are fetched in one request. OpenSearch JDBC driver's ends up setting fetch_size in the REST query to value provided to Statement.setFetchSize.

@dai-chen dai-chen transferred this issue from opensearch-project/sql Dec 14, 2022
@jlarue26
Copy link

Hi @MaxKsyunz any thoughts on when this bug will be resolved?

@acarbonetto
Copy link
Collaborator

Hi @MaxKsyunz any thoughts on when this bug will be resolved?

Working on it currently.

A draft PR is up for the base cases and we're hoping to get it into 2.6 release. Additional features for pagination (larger datasets, WHERE filter, and aggregation) will be coming out periodically with subsequent releases (2.7...).

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
None yet
Development

No branches or pull requests

3 participants