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

BigQuery: JSON writer does not function if table schema has fields with mixed-case names #1366

Closed
stephenjudkins opened this issue Oct 19, 2021 · 0 comments · Fixed by #1369
Labels
api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API.

Comments

@stephenjudkins
Copy link
Contributor

Thanks for stopping by to let us know something could be better!

Environment details

  1. Specify the API at the beginning of the title. For example, "BigQuery: ...").
    General, Core, and Other are also allowed as types
  2. OS type and version: N/A
  3. Java version: N/A
  4. bigquerystorage version(s): 2.4.0 (using both v1 and v1beta2 API versions)

Steps to reproduce

  1. Create a bigquery table with a field with mixed case, such as fooBar
  2. Attempt to use JsonStreamWriter to save a record to this table

Stack trace

com.google.api.pathtemplate.ValidationException: Field at index 3 has mismatch names (publishedAt) (publishedat)
    at com.google.cloud.bigquery.storage.v1beta2.JsonToProtoMessage.convertJsonToProtoMessageImpl(JsonToProtoMessage.java:133)
    at com.google.cloud.bigquery.storage.v1beta2.JsonToProtoMessage.convertJsonToProtoMessage(JsonToProtoMessage.java:86)
    at com.google.cloud.bigquery.storage.v1beta2.JsonStreamWriter.append(JsonStreamWriter.java:110)
    at com.google.cloud.bigquery.storage.v1beta2.JsonStreamWriter.append(JsonStreamWriter.java:90)

Any additional information below

This is because the comparison here does not take into account the fact that the protobuf schema always has lower case field names, while the the BQ table schema field may have mixed-cased field names:

@product-auto-label product-auto-label bot added the api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. label Oct 19, 2021
gcf-merge-on-green bot pushed a commit that referenced this issue Oct 25, 2021
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-bigquerystorage/issues/new/choose) 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 #1366☕️
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