Is there a way to export a BigQuery table's schema as JSON?

后端 未结 3 1178
走了就别回头了
走了就别回头了 2020-12-22 23:24

A BigQuery table has schema which can be viewed in the web UI, updated, or used to load data with the bq tool as a JSON file. However, I can\'t find a way to du

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-23 00:16

    You can use REST API call to get BigQuery table schema as JSON. Documentation link: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/get

    curl 'https://bigquery.googleapis.com/bigquery/v2/projects/project-name/datasets/dataset-name/tables/table-name' \
         --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
         --header 'Accept: application/json' \
         --compressed
    

提交回复
热议问题