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

JsonToProtoMessage.fillField can not handle null values #1258

Closed
kgoderis opened this issue Aug 22, 2021 · 3 comments · Fixed by #1288
Closed

JsonToProtoMessage.fillField can not handle null values #1258

kgoderis opened this issue Aug 22, 2021 · 3 comments · Fixed by #1288
Assignees
Labels
api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@kgoderis
Copy link

JsonStreamWriter.append() fails when adding a JSONArray in which some fields are null because JsonToProtoMessage.fillField() does not handle null values returned by java.lang.Object val = json.get(exactJsonKeyName); (line 135).

null values should be supported because the Schema used to create the JsonStreamWriter could contain fields with a NULLABLE mode.

@product-auto-label product-auto-label bot added the api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. label Aug 22, 2021
@meredithslota meredithslota added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Aug 28, 2021
@yirutang
Copy link
Contributor

For null fields, we assumed the field will simply not be there. So if a field is null, we will just ignore that field?

@kgoderis
Copy link
Author

Yes, that is what could be done. FYI in my case the json submitted was the result of the Jackson ObjectMapper, I need to check if that one can skip null values as well. But it would be more logical for the lib to stay in line with BQ Schemas that can contain nullable fields

@yirutang
Copy link
Contributor

I see. it would be an easy fix then.

@meredithslota meredithslota added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Aug 31, 2021
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. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants