KEMBAR78
BigQuery: JSON writer does not function if table schema has fields with mixed-case names · Issue #1366 · googleapis/java-bigquerystorage · GitHub
Skip to content

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

@stephenjudkins

Description

@stephenjudkins

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigquerystorageIssues related to the googleapis/java-bigquerystorage API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions