Hi,
I’m attempting to create a partitioned table within BigQuery. My model has the below parameters set:
{{
config(
materialized = "table",
tag=['cust_model'],
partition_by = {
"field": "partition_date",
"data_type": "date",
"granularity": "day"
},
require_partition_filter = true
)
}}
‘partition_date’ is a date field in the format %Y-%m-%d. See below query excerpt (min_start_date is a string in yyyyMMdd format E.G 20230724):
CAST(CONCAT(SUBSTR(min_start_date,0,4),'-',SUBSTR(min_start_date,5,2),'-',SUBSTR(min_start_date,7,2)) AS DATE) AS partition_date
When I run the model containing a different partition_date, the existing partition is removed. What I would like is for there to be a second partition with the new date, E.G:
Partition_1 = 2023_07_24
Partition_2 = 2023_07_31
…
I understand there are incremental_models, however each new partition will contain a new set of data, so I thought a normal table materialization would be better.
Any help is greatly appreciated.