Skip to content

BigQuery: expose public helper method to convert a list of schema fields to/from a list of schema dictionaries (JSON) #3723

@tswast

Description

@tswast

I've received some feedback asking how to take a schema from the client library and save it to a JSON file. One reason to do this is the bq command-line tool accepts a schema file, formatted like

[
  {"name": "name", "type": "string", "mode": "required"},
  {"name": "gender", "type": "string", "mode": "nullable"},
  {"name": "count", "type": "integer", "mode": "required"}
]

Note: this format is the same as the API representation.

It would be great if our client libraries could read/write in this format.

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions