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

feat: expose row level serialization failures for JsonStreamWriter append #1686

Merged
merged 7 commits into from
Jul 7, 2022

Conversation

noak2
Copy link
Contributor

@noak2 noak2 commented Jun 28, 2022

No description provided.

@noak2 noak2 requested review from a team and steffnay June 28, 2022 13:47
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. labels Jun 28, 2022
@noak2 noak2 changed the title Expose row level serialization failures for JsonStreamWriter append feat: expose row level serialization failures for JsonStreamWriter append Jun 28, 2022
Copy link
Contributor

@gnanda gnanda left a comment

Choose a reason for hiding this comment

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

Just some minor nits

currentRequestSize += protoMessage.getSerializedSize();
} catch (IllegalArgumentException
| IllegalStateException
| NullPointerException exception) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to catch all of these? IllegalState is ambiguous, but NullPointerException seems like a more serious error indicating something is wrong, rather than a "row-level" error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In JsonToProtoMessage#convertJsonToProtoMessage there are some Null and state checks, some of them are not relevant to a single line and some are, for example Preconditions.checkState(json.length() != 0, "JSONObject is empty."); is relevant for a single row and should be reported as such.

I'm not sure how we can even get to a point from JsonStreamWriter that we will have null values in JsonObjects, so I will remove the catch for null and state exceptions for now, and add them later if we see it's needed

@prash-mi prash-mi added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 5, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 5, 2022
@steffnay steffnay added the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 7, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 7, 2022
@noak2 noak2 requested a review from a team as a code owner July 7, 2022 16:35
@steffnay steffnay added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 7, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 7, 2022
@steffnay steffnay merged commit bba0746 into googleapis:main Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants