Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Cursor integration #76

Merged
merged 15 commits into from
May 7, 2020
Merged

Conversation

abbashus
Copy link
Contributor

@abbashus abbashus commented May 1, 2020

Issue: #74

Description of changes:
This change is a part of the cursor support for JDBC driver to use new paginated response.

Usage:

  • The default value of fetchSize is 0 - meaning user will get non-paginated response as supported by Opendistro SQL plugin
  • The fetchSize can be provided in multiple ways:
    • Via connection string
      String url = "jdbc:elasticsearch://localhost:9200?";
      ...
      Connection con = DriverManager.getConnection(url);
  • By passing Properties object
Example 1:

        Properties properties = new Properties();
        properties.setProperty("fetchSize", "300");
        Connection con = DriverManager.getConnection(url, properties );

Example 2:

        InputStream input = new FileInputStream("path/to/config.properties")
        Properties properties = new Properties();
        properties.load(input);
        Connection con = DriverManager.getConnection(url, properties);
        Connection con = DriverManager.getConnection(url );
        Statement st = con.createStatement();
        st.setFetchSize(500);

When fetchSize is set in mutliple places, the final fetchSize value used is picked based on the following order of precedence:

Statement.setFetchSize() > Properties > Connection String

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@abbashus abbashus added the enhancement New feature or request label May 1, 2020
@abbashus abbashus marked this pull request as ready for review May 4, 2020 18:20
Copy link
Contributor

@davidcui1225 davidcui1225 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to Chen's comment about adding Javadoc & UTs

Copy link
Contributor

@chloe-zh chloe-zh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@abbashus abbashus merged commit 50bd69b into amazon-archives:master May 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants