Exploring Loading data to GBQ with POST request I haven't found how to rewrite existing table (current examples append data to existing table or create new table if it doesn't exist). I see that there is a possibility to do it with web console so I assume there is a way to resolve this task with POST request. Are there someone who knows it?
You should set WRITE_TRUNCATE value for configuration.load.writeDisposition property of job configuration
configuration.load.writeDisposition string [Optional] 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. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result.
The default value is WRITE_APPEND.Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
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