currently I'm working on a query which looks like following
WITH subquery1 AS (
SELECT ...
FROM rawdata
WHERE DATE(_PARTITIONTIME) = "2021-03-09"
),
subquery2 AS (
SELECT ...
FROM subquery 1
),
subquery3 AS (
SELECT ...
FROM subquery1 join subquery2
)
SELECT * FROM subquery3
In my actually query i have 5 subqueries all building up on the previous ones. The query is working perfectly fine and I would like to have it as a view so I can use it in other queries.
Is there a way I can control the partition filter in the first subquery when calling the view? In some cases I just want to have one week, in other cases several months.