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

JsonStreamWriter simple types to string conversion #2436

Closed
anthavio opened this issue Mar 7, 2024 · 0 comments · Fixed by #2437
Closed

JsonStreamWriter simple types to string conversion #2436

anthavio opened this issue Mar 7, 2024 · 0 comments · Fixed by #2437
Labels
api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API.

Comments

@anthavio
Copy link
Contributor

anthavio commented Mar 7, 2024

We are trying to migrate from legacy streaming API but we encountered following difference when using storage api with default stream.
Using storage writer, integer value in data is NOT automatically converted to string for fields with string type in schema. Oddly enough other way around, string in data but integer in schema, automatic conversion happens when string in data value actually is number string, for example "1"

Looking into JsonToProtoMessage code, lots of conversion is performed in different cases therefore I believe simple conversion like this should be done too.
If it is unacceptable for some reason, we can add boolean field (allowToStringConversions) to JsonStreamWriter Builder as feature flag to enable these conversions on request rather then by default.

Here is PR with suggested changes - #2437

@product-auto-label product-auto-label bot added the api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. label Mar 7, 2024
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant