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

fix: fix write replace in grpcStruct #2901

Merged

Conversation

harshachinta
Copy link
Contributor

@harshachinta harshachinta commented Feb 21, 2024

#2846 has refactored the result set class. However the writeReplace method was not updated. This PR fixes it.
Impact: This will break the import export functionality in Pantheon and dataflow templates.

The error is as follows

Caused by: java.lang.IllegalArgumentException: Unable to encode element '[string_value: "Singers5"
, string_value: "1"
, string_value: "CgFB"
, null_value: NULL_VALUE
]' with coder 'SerializableCoder(com.google.cloud.spanner.Struct)'.
    org.apache.beam.sdk.coders.Coder.getEncodedElementByteSize(Coder.java:300)
    org.apache.beam.sdk.coders.Coder.registerByteSizeObserver(Coder.java:291)
    org.apache.beam.fn.harness.data.PCollectionConsumerRegistry$SampleByteSizeDistribution.tryUpdate(PCollectionConsumerRegistry.java:509)
    org.apache.beam.fn.harness.data.PCollectionConsumerRegistry$MetricTrackingFnDataReceiver.accept(PCollectionConsumerRegistry.java:336)
    org.apache.beam.fn.harness.data.PCollectionConsumerRegistry$MetricTrackingFnDataReceiver.accept(PCollectionConsumerRegistry.java:275)
Caused by: java.lang.ClassCastException: class com.google.protobuf.Value cannot be cast to class java.lang.String (com.google.protobuf.Value is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')
    com.google.cloud.spanner.GrpcStruct.writeReplace(GrpcStruct.java:92)

Job link: https://pantheon.corp.google.com/dataflow/jobs/us-central1/2024-02-21_00_14_12-8497790410952556713;bottomTab=JOB_LOGS;logsSeverity=ERROR;graphView=0?project=span-cloud-testing&pageState=(%22dfTime%22:(%22l%22:%22dfJobMaxTime%22))&mods=logs_tg_staging

@harshachinta harshachinta requested a review from a team as a code owner February 21, 2024 09:23
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: spanner Issues related to the googleapis/java-spanner API. labels Feb 21, 2024
@harshachinta harshachinta added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 21, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 21, 2024
@harshachinta harshachinta changed the title fix(spanner): fix write replace in grpcStruct fix: fix write replace in grpcStruct Feb 21, 2024
@harshachinta harshachinta merged commit 64b9042 into googleapis:main Feb 21, 2024
24 of 25 checks passed
gcf-merge-on-green bot pushed a commit that referenced this pull request Feb 21, 2024
🤖 I have created a release *beep* *boop*
---


## [6.60.0](https://togithub.com/googleapis/java-spanner/compare/v6.59.0...v6.60.0) (2024-02-21)


### Features

* Add an API method for reordering firewall policies ([62319f0](https://togithub.com/googleapis/java-spanner/commit/62319f032163c4ad3e8771dd5f92e7b8a086b5ee))
* **spanner:** Add field for multiplexed session in spanner.proto ([62319f0](https://togithub.com/googleapis/java-spanner/commit/62319f032163c4ad3e8771dd5f92e7b8a086b5ee))
* Update TransactionOptions to include new option exclude_txn_from_change_streams ([#2853](https://togithub.com/googleapis/java-spanner/issues/2853)) ([62319f0](https://togithub.com/googleapis/java-spanner/commit/62319f032163c4ad3e8771dd5f92e7b8a086b5ee))


### Bug Fixes

* Add ensureDecoded to proto type ([#2897](https://togithub.com/googleapis/java-spanner/issues/2897)) ([e99b78c](https://togithub.com/googleapis/java-spanner/commit/e99b78c5d810195d368112eed2b185d2d99e62a9))
* **spanner:** Fix write replace used by dataflow template and import export ([#2901](https://togithub.com/googleapis/java-spanner/issues/2901)) ([64b9042](https://togithub.com/googleapis/java-spanner/commit/64b90429d4fe53f8509a3923e046406b4bc5876a))


### Dependencies

* Update dependency com.google.cloud:google-cloud-trace to v2.36.0 ([#2749](https://togithub.com/googleapis/java-spanner/issues/2749)) ([51a348a](https://togithub.com/googleapis/java-spanner/commit/51a348a0c2b84106ea763721bed3420a0d07f30a))


### Documentation

* Update comments ([62319f0](https://togithub.com/googleapis/java-spanner/commit/62319f032163c4ad3e8771dd5f92e7b8a086b5ee))
* Update the comment regarding eligible SQL shapes for PartitionQuery ([62319f0](https://togithub.com/googleapis/java-spanner/commit/62319f032163c4ad3e8771dd5f92e7b8a086b5ee))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
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: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants