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

Migrate JDBC to page source API #25123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

raunaqmorarka
Copy link
Member

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:

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Feb 24, 2025
@raunaqmorarka raunaqmorarka force-pushed the raunaq/jdbc-page branch 4 times, most recently from fd8fb98 to 5cc9309 Compare February 25, 2025 07:27
@github-actions github-actions bot added the redshift Redshift connector label Feb 25, 2025
@@ -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()));
Copy link
Contributor

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(() -> {
Copy link
Contributor

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);
Copy link
Contributor

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());
Copy link
Contributor

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");
Copy link
Contributor

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;
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants