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

java jdbc option FetchSize improvement #2156

Open
YoKv opened this issue Sep 12, 2024 · 0 comments
Open

java jdbc option FetchSize improvement #2156

YoKv opened this issue Sep 12, 2024 · 0 comments
Labels
Type: enhancement New feature or request

Comments

@YoKv
Copy link

YoKv commented Sep 12, 2024

What feature or improvement would you like to see?

according to https://arrow.apache.org/adbc/current/java/quickstart.html

final Map<String, Object> parameters = new HashMap<>();
parameters.put(AdbcDriver.PARAM_URL, "jdbc:postgresql://localhost:5432/postgres");
try (
    BufferAllocator allocator = new RootAllocator();
    AdbcDatabase db = new JdbcDriver(allocator).open(parameters);
    AdbcConnection adbcConnection = db.connect();
    AdbcStatement stmt = adbcConnection.createStatement()

) {
    stmt.setSqlQuery("select * from foo");
    AdbcStatement.QueryResult queryResult = stmt.executeQuery();
    while (queryResult.getReader().loadNextBatch()) {
        // process batch
    }
}  catch (AdbcException e) {
    // throw
}

stmt.executeQuery() will cause oom

in jdbc, statement has a method statement.setFetchSize(batchSize); to fetch a part of data
can give a option to define this and queryResult.getReader().loadNextBatch() load this size data

@YoKv YoKv added the Type: enhancement New feature or request label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant