× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Big Query table to be extracted as JSON in Local machine

Marton
Nov 18, 2015
<p>You need to use Google Cloud Storage for your export job. Exporting data from BigQuery is explained <a href="https://cloud.google.com/bigquery/exporting-data-from-bigquery" rel="nofollow">here</a>, check also the variants for different path syntaxes.</p> <p>Then you can download the files from GCS to your local storage.</p> <p><a href="https://cloud.google.com/storage/docs/gsutil?hl=en" rel="nofollow">Gsutil</a> tool can help you further to download the file from GCS to local machine.</p> <p>You first need to export to GCS, then to transfer to local machine.</p> <p>If you use the BQ Cli tool, then you can set output format to JSON, and you can redirect to a file. This way you can achieve some export locally, but it has certain other limits.</p> <p>this exports the first 1000 line as JSON</p> <pre><code>bq --format=prettyjson query --n=1000 "SELECT * from publicdata:samples.shakespeare" &gt; export.json </code></pre> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/32593891/Big%20Query%20table%20to%20be%20extracted%20as%20JSON%20in%20Local%20machine/32594288">Stack Overflow</a>.</p>
comments powered by Disqus