dataform-co/dataform

Feature request : support for BigQuery non incremental materialized view

Closed this issue · 4 comments

We are unable to apply "max_staleness" and "allow_non_incremental_definition" options for BigQuery non incremental materialized views :

config { 
    type: "view",
    materialized: true,
    bigquery: {
        additionalOptions: {
            enable_refresh: "true",
            refresh_interval_minutes: "60",
            max_staleness = interval "4" hour,
            allow_non_incremental_definition = true
        }
    }
}

Hi Olivier,

Looking at that config, I suspect that compilation is failing because of the missing quotes in max_staleness = interval "4" hour.

Updating this to:

config { 
    type: "view",
    materialized: true,
    bigquery: {
        additionalOptions: {
            enable_refresh: "true",
            refresh_interval_minutes: "60",
            max_staleness = `interval "4" hour`,
            allow_non_incremental_definition = true
        }
    }
}

Should fix the issue.

Hi @Ekrekr,
Thanks for the help.
However it doesn't work. I got the following error message : "Invalid shorthand property initializer" when I add :

max_staleness = `interval "4" hour`,
allow_non_incremental_definition = true

Ah, also the equals rather than using colons, allow_non_incremental_definition = true -> allow_non_incremental_definition: true.

config { 
    type: "view",
    materialized: true,
    bigquery: {
        additionalOptions: {
            enable_refresh: "true",
            refresh_interval_minutes: "60",
            max_staleness: 'interval "4" hour',
            allow_non_incremental_definition: true
        }
    }
}

Yes, we're good with your code and double quote on allow_non_incremental_definition value :

        additionalOptions: {
            enable_refresh: "true",
            refresh_interval_minutes: "60",
            max_staleness: 'interval "4" hour',
            allow_non_incremental_definition: "true"
        }

Thanks a lot!