Export a BigQuery table's schema definition into JSON ?

You can retrieve the Bigquery Table definition as a JSON file by using the below command:

bq show --schema --format=prettyjson mydataset.mytable > /tmp/myschema.json

Where:

  • mydataset - Is the name of the Bigquery Dataset
  • mytable - Is the name of your Bigquery Table
  • myschema.json - is the resultant JSON file that contains the table definition

nVector

posted on 08 May 20

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds