dategoogle-bigquerypartition

BigQuery (BQ) - Drop Partition


I'm using the BQ CLI (https://cloud.google.com/bigquery/bq-command-line-tool).

I didn't find how to Delete DAY Partition data.

For example, i have a DAY PARTITIONED table that holds data for dates 2016-09-01 and until 2016-09-30.

I need to delete the "2016-09-15" partition completely.

Is this possible through CLI command ?


Solution

  • You likely do not have to delete it to re-insert the data. See this link for details about how to re-state data in a specific portion of your date partitioned table.

    Basically, just use the --replace flag with the $YYYYMMDD table decorator with the bq CLI tool.