Forrest logo
back to the bq tool

bq:tldr:192e6

bq: Batch load data from a specific file in formats such as CSV, JSON, Parquet, and Avro to a table.
$ bq load --location=${location} --source_format=${select} ${dataset}.${table} ${path_to_source}
try on your machine

This command is a BigQuery command used to load data from a source file into a BigQuery table.

Here's how the different parts of the command work:

  • bq load: This is the main command that tells the BigQuery command-line tool to load data into a table.
  • --location=${location}: This flag specifies the geographic location where the BigQuery dataset is located. The ${location} is a placeholder for the actual location value.
  • --source_format=${select}: This flag determines the format of the source file that will be loaded into the table. The ${select} is a placeholder for the desired source format, such as CSV or JSON.
  • ${dataset}.${table}: This specifies the dataset and table where the data will be loaded into. ${dataset} and ${table} are placeholders for the actual dataset and table names.
  • ${path_to_source}: This is the path to the source file that contains the data. It can be a local file path or a Cloud Storage URI depending on the location of the source file.

In summary, this command instructs BigQuery to load the data from ${path_to_source} file into the ${dataset}.${table} table using the specified ${location} and ${select} format.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the bq tool