I am wondering if the bq command line utility supports the writeDisposition : WRITE_TRUNCATE option. I have searched the docs thoroughly, and help within bq command. Is it possible to specify configuration.load.writeDisposition with the bq utility? The command line utility is great, hopefully it is supported with it.
In the API it is of course: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load
Thanks.
Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data and uses the schema from the query result. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table.
Temporary and permanent tables BigQuery uses temporary tables to cache query results that aren't written to a permanent table. The tables are created in a special dataset and named randomly. You can also create temporary tables for your own use.
The bq command-line tool is a Python-based command-line tool for BigQuery. This page contains general information about using the bq command-line tool. For a complete reference of all bq commands and flags, see the bq command-line tool reference.
I believe --replace should set the write_disposition to truncate in places in the BQ cli where relevant (such as bq load).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With