Quantcast
Channel: How to delete or empty a table that is in BigQuery using Python - Stack Overflow
Viewing all articles
Browse latest Browse all 354

Answer by David McNeill for How to delete or empty a table that is in BigQuery using Python

$
0
0

You can't truncate directly.

The --replace parameter to a bq cli load job has the effect you want, clearing out the existing data. Also referred to as WRITE_TRUNCATE when using API mode.

bq load --autodetect --replace --source_format=NEWLINE_DELIMITED_JSON mydataset.mytable gs://mybucket/mydata.json

Viewing all articles
Browse latest Browse all 354

Trending Articles