9951 explained code solutions for 126 technologies


google-big-queryHow can I use Google BigQuery on a Windows system?


Google BigQuery is a serverless, highly scalable, and cost-effective cloud data warehouse. It can be used on a Windows system by following the steps below:

  1. Download and install the Google Cloud SDK for Windows from here.

  2. Open a command prompt and enter the following command to install the BigQuery command-line tool:

gcloud components install bq
  1. Initialize the gcloud environment by running the following command:
gcloud init
  1. Create a BigQuery dataset by running the following command:
bq mk mydataset
  1. Upload a CSV file to the dataset using the following command:
bq load --source_format=CSV mydataset.mytable gs://mybucket/mydata.csv myschema.json
  1. Run a query on the dataset using the following command:
bq query --use_legacy_sql=false 'SELECT * FROM mydataset.mytable'
  1. You can view the query results by running the following command:
bq view --format=prettyjson mydataset.mytable

The output of the above command will be a JSON representation of the query results.

Edit this code on GitHub