Hi there,
I found that variable declaration works in pre_operations{} when config { type: ‘table’ }, but if I change the type to view, I get the titular error. This is a reproducible error:
config {
type: 'view'
}
pre_operations {
DECLARE v_min_date DATE DEFAULT DATE_TRUNC(DATE_SUB(CURRENT_DATE, INTERVAL 24 MONTH), MONTH);
}
WITH
foo AS (
SELECT v_min_date AS bar
)
SELECT * FROM foo
Is this a bug or am I doing something wrong?