-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Migrate JDBC to page source API #25123
base: master
Are you sure you want to change the base?
Conversation
fd8fb98
to
5cc9309
Compare
5cc9309
to
d35009f
Compare
@@ -119,6 +123,20 @@ else if (javaType == Slice.class) { | |||
else { | |||
statement = jdbcClient.buildSql(session, connection, split, (JdbcTableHandle) table, columnHandles); | |||
} | |||
pageBuilder = new PageBuilder(columnHandles.stream().map(JdbcColumnHandle::getColumnType).collect(toImmutableList())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrap after .stream() and .map()
@@ -119,6 +123,20 @@ else if (javaType == Slice.class) { | |||
else { | |||
statement = jdbcClient.buildSql(session, connection, split, (JdbcTableHandle) table, columnHandles); | |||
} | |||
pageBuilder = new PageBuilder(columnHandles.stream().map(JdbcColumnHandle::getColumnType).collect(toImmutableList())); | |||
resultSetFuture = CompletableFuture.supplyAsync(() -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: static import supplyAsync
throw handleSqlException(e); | ||
} | ||
finally { | ||
readTimeNanos.addAndGet(System.nanoTime() - start); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: static import nanoTime
return false; | ||
} | ||
|
||
verify(pageBuilder.isEmpty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, "Expected pageBuilder to be empty"
} | ||
throw sqlException; | ||
resultSet = getFutureValue(resultSetFuture); | ||
verify(resultSet != null, "resultSet is null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resultSet = requireNonNull(getFutureValue(resultSetFuture), "resultSet is null")
catch (SQLException | RuntimeException e) { | ||
throw handleSqlException(e); | ||
} | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can calculate this, right?
Description
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: