Using the bq utility for BigQuery
The bq
command-line utility is used to interact with the Google BigQuery service on Google Cloud Platform:
- Use the following command to check the version of the
bq
utility once the SDK is installed:
bq version
- Type the following command to confirm which project the
bq
utility will use. Thebq
utility shares settings with thegcloud
utility. If you wish to change the project, then run the command in the second line and choose the project you want to work on:
gcloud info gcloud init
Note
If an older version of Google Cloud SDK is installed on the machine, then run the bq init
command to choose the default project for the bq
utility to use. Use the bq help
option to see the complete details of the command, its options, and its switches.
- The first step in using BigQuery is to create a dataset in a project and then create tables under the dataset. The following command will create an empty dataset named
HumanResourceDS
in the project:
bq mk HumanResourceDS
- To create a...