feat: add PartitionedUpdate support to executor#2228
feat: add PartitionedUpdate support to executor#2228gcf-merge-on-green[bot] merged 9 commits intogoogleapis:mainfrom
Conversation
|
The tests are expected to fail until proto changes for PartitionedUpdateAction is made public. |
7daad81 to
90539fc
Compare
|
@gyang-google: Can you please review this PR once? |
|
LGTM |
| dbClient.executePartitionedUpdate( | ||
| Statement.of(action.getUpdate().getSql()), | ||
| Options.tag(options.getTag()), | ||
| Options.priority(RpcPriority.fromProto(options.getRpcPriority()))); |
There was a problem hiding this comment.
Query - What's the behaviour when null is passed into this method?
There was a problem hiding this comment.
RpcPriority.fromProto(null) will return RpcPriority.UNSPECIFIED. Added a unit test for this too.
| for (RpcPriority e : RpcPriority.values()) { | ||
| if (e.proto.equals(proto)) return e; | ||
| } | ||
| return null; |
There was a problem hiding this comment.
It's preferred to not return nulls and instead return some modelled type like UNRECOGNIZED/UNKNOWN/UNSPECIFIED. With nulls, the client does not have a good way to know underlying reason i.e invalid enum type being the actual issue.
There was a problem hiding this comment.
Added a RpcPriority.UNSPECIFIED to enum to map to Priority.PRIORITY_UNSPECIFIED. If a null value is passed in, we would return RpcPriority.UNSPECIFIED.
🤖 I have created a release *beep* *boop* --- ## [6.38.0](https://togithub.com/googleapis/java-spanner/compare/v6.37.0...v6.38.0) (2023-03-20) ### Features * Add option to wait on session pool creation ([#2329](https://togithub.com/googleapis/java-spanner/issues/2329)) ([ff17244](https://togithub.com/googleapis/java-spanner/commit/ff17244ee918fa17c96488a0f7081728cda7b342)) * Add PartitionedUpdate support to executor ([#2228](https://togithub.com/googleapis/java-spanner/issues/2228)) ([2c8ecf6](https://togithub.com/googleapis/java-spanner/commit/2c8ecf6fee591df95ee4abfa230c3fcf0c34c589)) ### Bug Fixes * Correcting the proto field Id for field data_boost_enabled ([#2328](https://togithub.com/googleapis/java-spanner/issues/2328)) ([6159d7e](https://togithub.com/googleapis/java-spanner/commit/6159d7ec49b17f6bc40e1b8c93d1e64198c59dcf)) * Update executeCloudBatchDmlUpdates. ([#2326](https://togithub.com/googleapis/java-spanner/issues/2326)) ([27ef53c](https://togithub.com/googleapis/java-spanner/commit/27ef53c8447bd51a56fdfe6b2b206afe234fad80)) ### Dependencies * Update dependency com.google.cloud:google-cloud-monitoring to v3.14.0 ([#2333](https://togithub.com/googleapis/java-spanner/issues/2333)) ([9c81109](https://togithub.com/googleapis/java-spanner/commit/9c81109e452d6bae2598cf6cf541a09423a8ed6e)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.5.0 ([#2335](https://togithub.com/googleapis/java-spanner/issues/2335)) ([5eac2be](https://togithub.com/googleapis/java-spanner/commit/5eac2beb2ce5eebb61e70428e2ac2e11593fc986)) * Update dependency com.google.cloud:google-cloud-trace to v2.13.0 ([#2334](https://togithub.com/googleapis/java-spanner/issues/2334)) ([c461ba0](https://togithub.com/googleapis/java-spanner/commit/c461ba0b1a145cc3e9bee805ec6ad827376e5168)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
This PR adds support for PartitionedUpdate to Cloud Client Executor Framework.
🤖 I have created a release *beep* *boop* --- ## [6.38.0](https://togithub.com/googleapis/java-spanner/compare/v6.37.0...v6.38.0) (2023-03-20) ### Features * Add option to wait on session pool creation ([googleapis#2329](https://togithub.com/googleapis/java-spanner/issues/2329)) ([ff17244](https://togithub.com/googleapis/java-spanner/commit/ff17244ee918fa17c96488a0f7081728cda7b342)) * Add PartitionedUpdate support to executor ([googleapis#2228](https://togithub.com/googleapis/java-spanner/issues/2228)) ([2c8ecf6](https://togithub.com/googleapis/java-spanner/commit/2c8ecf6fee591df95ee4abfa230c3fcf0c34c589)) ### Bug Fixes * Correcting the proto field Id for field data_boost_enabled ([googleapis#2328](https://togithub.com/googleapis/java-spanner/issues/2328)) ([6159d7e](https://togithub.com/googleapis/java-spanner/commit/6159d7ec49b17f6bc40e1b8c93d1e64198c59dcf)) * Update executeCloudBatchDmlUpdates. ([googleapis#2326](https://togithub.com/googleapis/java-spanner/issues/2326)) ([27ef53c](https://togithub.com/googleapis/java-spanner/commit/27ef53c8447bd51a56fdfe6b2b206afe234fad80)) ### Dependencies * Update dependency com.google.cloud:google-cloud-monitoring to v3.14.0 ([googleapis#2333](https://togithub.com/googleapis/java-spanner/issues/2333)) ([9c81109](https://togithub.com/googleapis/java-spanner/commit/9c81109e452d6bae2598cf6cf541a09423a8ed6e)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.5.0 ([googleapis#2335](https://togithub.com/googleapis/java-spanner/issues/2335)) ([5eac2be](https://togithub.com/googleapis/java-spanner/commit/5eac2beb2ce5eebb61e70428e2ac2e11593fc986)) * Update dependency com.google.cloud:google-cloud-trace to v2.13.0 ([googleapis#2334](https://togithub.com/googleapis/java-spanner/issues/2334)) ([c461ba0](https://togithub.com/googleapis/java-spanner/commit/c461ba0b1a145cc3e9bee805ec6ad827376e5168)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
This PR adds support for PartitionedUpdate to Cloud Client Executor Framework.