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

ReadSession: selectedFields on null record coalesced to 0 value #2284

Open
RustedBones opened this issue Oct 24, 2023 · 2 comments
Open

ReadSession: selectedFields on null record coalesced to 0 value #2284

RustedBones opened this issue Oct 24, 2023 · 2 comments
Assignees
Labels
api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. priority: p2 Moderately-important priority. Fix may not be included in next release.

Comments

@RustedBones
Copy link

RustedBones commented Oct 24, 2023

Environment details

OS type and version: Linux, Ubuntu 22.04
Java version: 11
version(s): 2.41.1, 2.44.0

Steps to reproduce

Considering this table
image

With the following data
image

Reading the table with AVRO format without any selected fields gives the expected result:

{"required": {"int": 0, "string": "0"}, "optional": null, "repeated": []}
{"required": {"int": 1, "string": "1"}, "optional": {"int": 1, "string": "1"}, "repeated": [{"int": 1, "string": "1"}]}
{"required": {"int": 2, "string": "2"}, "optional": {"int": 2, "string": "2"}, "repeated": [{"int": 2, "string": "2"}]}
{"required": {"int": 3, "string": "3"}, "optional": {"int": 3, "string": "3"}, "repeated": [{"int": 3, "string": "3"}]}
{"required": {"int": 4, "string": "4"}, "optional": {"int": 4, "string": "4"}, "repeated": [{"int": 4, "string": "4"}]}
{"required": {"int": 5, "string": "5"}, "optional": {"int": 5, "string": "5"}, "repeated": [{"int": 5, "string": "5"}]}
{"required": {"int": 6, "string": "6"}, "optional": {"int": 6, "string": "6"}, "repeated": [{"int": 6, "string": "6"}]}
{"required": {"int": 7, "string": "7"}, "optional": {"int": 7, "string": "7"}, "repeated": [{"int": 7, "string": "7"}]}
{"required": {"int": 8, "string": "8"}, "optional": {"int": 8, "string": "8"}, "repeated": [{"int": 8, "string": "8"}]}
{"required": {"int": 9, "string": "9"}, "optional": {"int": 9, "string": "9"}, "repeated": [{"int": 9, "string": "9"}]}

When now setting the selected fields to ["required", "optional.int"], the library returns the following

{"required": {"int": 0, "string": "0"}, "optional": {"int": 0}}
{"required": {"int": 1, "string": "1"}, "optional": {"int": 1}}
{"required": {"int": 2, "string": "2"}, "optional": {"int": 2}}
{"required": {"int": 3, "string": "3"}, "optional": {"int": 3}}
{"required": {"int": 4, "string": "4"}, "optional": {"int": 4}}
{"required": {"int": 5, "string": "5"}, "optional": {"int": 5}}
{"required": {"int": 6, "string": "6"}, "optional": {"int": 6}}
{"required": {"int": 7, "string": "7"}, "optional": {"int": 7}}
{"required": {"int": 8, "string": "8"}, "optional": {"int": 8}}
{"required": {"int": 9, "string": "9"}, "optional": {"int": 9}}

The 1st record is expected to return {"required": {"int": 0, "string": "0"}, "optional": null} instead. Somehow its value gets coalesced into 0.

@product-auto-label product-auto-label bot added the api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. label Oct 24, 2023
@RustedBones
Copy link
Author

For reference, scala code gist to reproduce

@Neenu1995 Neenu1995 added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Oct 27, 2023
@Neenu1995 Neenu1995 self-assigned this Oct 27, 2023
@RustedBones
Copy link
Author

Any update on this ?

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: p2 Moderately-important priority. Fix may not be included in next release.
Projects
None yet
Development

No branches or pull requests

2 participants