1
votes

Using the Bigquery Schedule functionality, is it possible to write truncate a partition using the run_time parameters like @run_time?

What I am trying to do is to give the destination table_name like mytable${run_time|"%Y%m%d"}, but this gives me an error saying:

Invalid partition decorator in column-partitioned table mytable$20200124 with partitioning field { value: "event_date" }

If I don't give the partition decorate the whole table is written truncated irrespective of the partition

1

1 Answers

1
votes

Yes, it is possible. I just replicated it with the following configuration Scheduled query configuration

Notice that the Partitioning field is empty. In addition, I found this issue where is provided the following workaround:

[...] If you just want to overwrite on partition, you could use MERGE statement on the query and set the "Destination table" to the column-partitioned table.