KEMBAR78
Handle missing/null repeated optional fields when converting Json messages to Protobuf · Issue #1761 · googleapis/java-bigquerystorage · GitHub
Skip to content

Handle missing/null repeated optional fields when converting Json messages to Protobuf #1761

@yenchau-google

Description

@yenchau-google

Problem encountered / steps to reproduce

For repeated columns in the BigQuery TableSchema, the JsonToProtoMessage.convertJsonToProtoMessage converter [here] requires that the input Json object both contains

  • the array field, and
  • it is not null.

If either of those things are not true, it fails with an error, before sending it to BigQuery

Investigations:

We tracked the cause of the error down to the fillRepeatedField method inside that converter, specifically [this line] which throws an error if the Json field is null or missing: jsonArray = json.getJSONArray(exactJsonKeyName);

Therefore it would be great to get this issue fixed.
Many thanks.

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