To reproduce, put the .sqlx file below in a Dataform repo with dataform-core v3.0.2 installed:
config {
type: "incremental",
assertions: {
uniqueKey: ["foo"]
}
}
SELECT 1 as foo, 2 AS bar
This generates the SQL below for the assertion (view):
SELECT
*
FROM (
SELECT
TableAssertionsConfig,
COUNT(1) AS index_row_count
FROM `project-name.dataform.uniquekey_bug_test`
GROUP BY TableAssertionsConfig
) AS data
WHERE index_row_count > 1
This in turn generates the compilation error "Unrecognized name: TableAssertionsConfig at [6:5]."
This bug does not occur when:
An earlier version of dataform-core is used - function is as expected in v3.0.0 and not visible because of a different bug (now fixed) in v3.0.1.
The uniqueKey assertion is applied to a non-incremental table
uniqueKeys: [["foo"]] is used instead of uniqueKey: ["foo"] - this is a possible workaround if others are experiencing this, but not a fix I feel as uniqueKey is supported and documented here: https://cloud.google.com/dataform/docs/assertions#built-in .
To reproduce, put the .sqlx file below in a Dataform repo with dataform-core v3.0.2 installed:
This generates the SQL below for the assertion (view):
This in turn generates the compilation error "Unrecognized name: TableAssertionsConfig at [6:5]."
This bug does not occur when:
uniqueKeys: [["foo"]]
is used instead ofuniqueKey: ["foo"]
- this is a possible workaround if others are experiencing this, but not a fix I feel asuniqueKey
is supported and documented here: https://cloud.google.com/dataform/docs/assertions#built-in .