I have multiple incremental tables in Dataform
I have an issue with forcing filetring using partitioned by columns
For detailed explanation:
In every incremental model configuration block
I try to determine partitioning column and require filtering using this column using the following example model :
config {
type: “incremental”,
database: “destination_database”,
schema: “destination_schema”,
name: “orders_table”,
uniqueKey: [“order_id”],
bigquery: {
partitionBy: “DATE(created_at_date)”,
requirePartitionFilter : true
},
assertions: {
uniqueKey: [“order_id”]
}
}
SELECT *
FROM ${ref(“orders_table”)}
${ when(incremental(),
WHERE created_at_date > (SELECT MAX(created_at_date) from ${self()} )* *) }
When i try to run this, It generates multiple issues:
- Query error: (Cannot query over table ‘database_name.schema_name.dim_order’ without a filter over column(s) ‘created_at_date’ that can be used for partition) elimination when I try to run the model
- It fails the assertion also (quality test) as it require full table scan
How it can be solved ?
Thanks a lot