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: Add short, integer, long, boolean conversions into string #2437

Merged
merged 3 commits into from Mar 15, 2024

Conversation

anthavio
Copy link
Contributor

@anthavio 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 conversion on request rather then by default

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #2436☕️

If you write sample code, please follow the samples format.

@anthavio anthavio requested a review from a team as a code owner March 7, 2024 19:10
@anthavio anthavio requested a review from mrfaizal March 7, 2024 19:10
@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 Mar 7, 2024
@yirutang
Copy link
Contributor

lint error, please run:
mvn com.coveo:fmt-maven-plugin:format

@yirutang yirutang added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 14, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 14, 2024
@yirutang yirutang added kokoro:run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Mar 14, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 14, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Mar 14, 2024
@anthavio anthavio requested a review from a team as a code owner March 14, 2024 16:49
@yirutang yirutang added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 14, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 14, 2024
@yirutang yirutang merged commit 4f4216e into googleapis:main Mar 15, 2024
19 checks passed
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.

JsonStreamWriter simple types to string conversion
4 participants