-
Notifications
You must be signed in to change notification settings - Fork 85
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
Conversation
...oud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonStreamWriter.java
Outdated
Show resolved
Hide resolved
...bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/JsonStreamWriterTest.java
Show resolved
Hide resolved
There was a problem hiding this 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
...oud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonStreamWriter.java
Outdated
Show resolved
Hide resolved
...oud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonStreamWriter.java
Outdated
Show resolved
Hide resolved
currentRequestSize += protoMessage.getSerializedSize(); | ||
} catch (IllegalArgumentException | ||
| IllegalStateException | ||
| NullPointerException exception) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
No description provided.