You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "YoKv (via GitHub)" <gi...@apache.org> on 2024/09/12 10:53:02 UTC
[I] java jdbc option FetchSize improvement [arrow-adbc]
YoKv opened a new issue, #2156:
URL: https://github.com/apache/arrow-adbc/issues/2156
### 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org