Bigquery Materialized view on partitioned table

Viewed 987

I'm not able to create materialized view over a partitioned table, even though I have added partition filter in the query itself.

enter image description here

Source Table has partition column ts:timestamp, partitioned by date(ts) enter image description here

Query for materialized view:

create materialized view `materialized_view_1`
partition by Date(ts)
as
select Date(ts) date, count(*) count from `source_table`
where date(ts) > "2021-01-01"
group by 1

Error -

Table source_table requires a partition filter. Materialized views over a table that requires a partition filter must have a filter over the table's partitioning column or output the column.

0 Answers
Related