将模式从现有表转储到JSON文件的方法(最好是从命令行).可能吗?
试试下面
bq show bigquery-public-data:samples.wikipedia
可以使用–format标志美化输出
--format: none|json|prettyjson|csv|sparse|pretty:
命令输出的格式.选项包括:
none: ...
pretty: formatted table output
sparse: simpler table output
prettyjson: easy-to-read JSON format
json: maximally compact JSON
csv: csv format with header
The first three are intended to be human-readable, and the latter three are for passing to another program. If no format is selected, one will be chosen based on the command run.
Realized I provided partial answer :o)
下面是PO想要的
bq show --format=prettyjson bigquery-public-data:samples.wikipedia | jq '.schema.fields'