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: cast for Proto type #2862

Merged
merged 5 commits into from
Feb 8, 2024

Conversation

harshachinta
Copy link
Contributor

@harshachinta harshachinta commented Feb 6, 2024

This PR fixes the following issues,

  1. When export was done on PROTO type it was throwing a cast exception as follows,
Caused by: java.lang.ClassCastException: class com.google.cloud.spanner.AbstractResultSet$LazyByteArray cannot be cast to class com.google.cloud.ByteArray (com.google.cloud.spanner.AbstractResultSet$LazyByteArray and com.google.cloud.ByteArray are in unnamed module of loader 'app')

  1. Add ENUM compatibility for getLongArray method.
  2. null check for PROTO and ENUM

@harshachinta harshachinta requested a review from a team as a code owner February 6, 2024 14:01
@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 6, 2024
@harshachinta harshachinta added kokoro:force-run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Feb 7, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 7, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 7, 2024
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Feb 8, 2024
@harshachinta harshachinta added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 8, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 8, 2024
@@ -817,7 +820,8 @@ protected Value getValueInternal(int columnIndex) {
case INT64:
return Value.int64(isNull ? null : getLongInternal(columnIndex));
case ENUM:
return Value.protoEnum(getLongInternal(columnIndex), columnType.getProtoTypeFqn());
return Value.protoEnum(
isNull ? null : getLongInternal(columnIndex), columnType.getProtoTypeFqn());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @olavloite . Figured this null issue from your latest commit, but adding the fix here to take it in this release.
Hope that is fine with you.

@harshachinta harshachinta added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 8, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 8, 2024
@harshachinta harshachinta merged commit 0a95dba into googleapis:main Feb 8, 2024
24 checks passed
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