Skip to content

Batch read connection api native adjustments #2569

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

Conversation

burkedavison
Copy link
Member

No description provided.

@burkedavison burkedavison requested a review from a team as a code owner August 4, 2023 19:16
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: spanner Issues related to the googleapis/java-spanner API. labels Aug 4, 2023
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: m Pull request size is medium. labels Aug 4, 2023
@olavloite olavloite merged commit 1658a51 into batch-read-connection-api Aug 4, 2023
@olavloite olavloite deleted the batch-read-connection-api-native-adjustments branch August 4, 2023 19:41
getInstance(Dialect.GOOGLE_STANDARD_SQL).parse(Statement.of("RUN BATCH"));

} catch (Throwable ex) {
Logger logger = Logger.getLogger(AbstractStatementParser.class.getName());
Copy link
Member

Choose a reason for hiding this comment

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

Would AbstractStatementParser.class.getName() work when static initialization of failing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. An example of this being invoked when debugging the native configuration:

Aug 04, 2023 6:24:30 PM com.google.cloud.spanner.connection.AbstractStatementParser <clinit>
SEVERE: Static initialization failure.
com.google.cloud.spanner.connection.ClientSideStatementImpl$CompileException: Could not compile statement PARTITION <sql>
	at com.google.cloud.spanner.connection.ClientSideStatementImpl.compile(ClientSideStatementImpl.java:159)
	at com.google.cloud.spanner.connection.ClientSideStatements.getCompiledStatements(ClientSideStatements.java:76)
	at com.google.cloud.spanner.connection.SpannerStatementParser.<init>(SpannerStatementParser.java:41)
	at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller([Constructor.java:499](https://cs.corp.google.com/#search/&sq=package:%5Epiper$%20project:openjdk&q=java/lang/reflect/Constructor.java:499))
	at [email protected]/java.lang.reflect.ReflectAccess.newInstance([ReflectAccess.java:128](https://cs.corp.google.com/#search/&sq=package:%5Epiper$%20project:openjdk&q=java/lang/reflect/ReflectAccess.java:128))
	at [email protected]/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)
	at [email protected]/java.lang.Class.newInstance([DynamicHub.java:645](https://cs.corp.google.com/#search/&sq=package:%5Epiper$%20project:openjdk&q=java/lang/DynamicHub.java:645))
	at com.google.cloud.spanner.connection.AbstractStatementParser.getInstance(AbstractStatementParser.java:77)
	at com.google.cloud.spanner.connection.AbstractStatementParser.<clinit>(AbstractStatementParser.java:97)
	at com.google.cloud.spanner.connection.ConnectionImpl.getStatementParser(ConnectionImpl.java:320)
	at com.google.cloud.spanner.connection.ConnectionImpl.parseAndExecuteQuery(ConnectionImpl.java:1145)
	at com.google.cloud.spanner.connection.ConnectionImpl.executeQuery(ConnectionImpl.java:1016)
	at com.google.cloud.spanner.connection.it.ITBulkConnectionTest.lambda$testBulkCreateConnectionsMultiThreaded$0(ITBulkConnectionTest.java:74)
	at [email protected]/java.util.concurrent.FutureTask.run([FutureTask.java:264](https://cs.corp.google.com/#search/&sq=package:%5Epiper$%20project:openjdk&q=java/util/concurrent/FutureTask.java:264))
	at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker([ThreadPoolExecutor.java:1136](https://cs.corp.google.com/#search/&sq=package:%5Epiper$%20project:openjdk&q=java/util/concurrent/ThreadPoolExecutor.java:1136))
	at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run([ThreadPoolExecutor.java:635](https://cs.corp.google.com/#search/&sq=package:%5Epiper$%20project:openjdk&q=java/util/concurrent/ThreadPoolExecutor.java:635))
	at [email protected]/java.lang.Thread.run([Thread.java:833](https://cs.corp.google.com/#search/&sq=package:%5Epiper$%20project:openjdk&q=java/lang/Thread.java:833))
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine([PlatformThreads.java:775](https://cs.corp.google.com/#search/&q=f:com/oracle/svm/core/thread/PlatformThreads.java:775))
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine([PosixPlatformThreads.java:203](https://cs.corp.google.com/#search/&q=f:com/oracle/svm/core/posix/thread/PosixPlatformThreads.java:203))
Caused by: java.lang.ClassNotFoundException: com.google.cloud.spanner.connection.ClientSideStatementPartitionExecutor
	at [email protected]/java.lang.Class.forName([DynamicHub.java:1132](https://cs.corp.google.com/#search/&sq=package:%5Epiper$%20project:openjdk&q=java/lang/DynamicHub.java:1132))
	at [email protected]/java.lang.Class.forName([DynamicHub.java:1105](https://cs.corp.google.com/#search/&sq=package:%5Epiper$%20project:openjdk&q=java/lang/DynamicHub.java:1105))
	at com.google.cloud.spanner.connection.ClientSideStatementImpl.compile(ClientSideStatementImpl.java:154)
	... 18 more

olavloite added a commit that referenced this pull request Aug 4, 2023
* feat: support partitioned queries + data boost in Connection API

Adds support for Partitioned Queries and Data Boost in the Connection API.
This enables the use of these features in the JDBC driver and PGAdapter.

* fix: match the correct group in regex

* feat: add more SQL statements for partitioned queries

* chore: refactor client side statements to accept the entire parsed statement

Refactor the internal interface of client-side statements so these receive the
entire parsed statement, including any query parameters in the statement. This
allows us to create client-side statements that actually use the query parameters
that have been specified by the user.

* chore: simplify test

* chore: cleanup differences

* chore: cleanup unrelated changes

* fix: update converter name

* test: add more tests

* chore: add missing license header

* fix: handle empty partitioned queries correctly

* fix: do not use any random staleness for partitioned queries

* fix: only return false for next() if all have finished

* chore: rename to autoPartitionMode

* chore: rename sql statements + add tests for empty results

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: address review comments

* Batch read connection api native adjustments (#2569)

* chore: add ClientSideStatementPartitionExecutor to SpannerFeature

* chore: wrap AbstractStatementParser static initialization in try/catch

* chore: add ClientSideStatementRunPartitionExecutor to SpannerFeature

* chore: add ClientSideStatementRunPartitionedQueryExecutor to SpannerFeature

* chore: lint formatting

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Burke Davison <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants