You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 .
The text was updated successfully, but these errors were encountered:
stevenleggdfe
changed the title
uniqueKey assertions generate invalid SQL for incremental table in v3.0.1/2
uniqueKey assertions generate invalid SQL for incremental table in v3.0.2
Aug 12, 2024
stevenleggdfe
changed the title
uniqueKey assertions generate invalid SQL for incremental table in v3.0.2
uniqueKey assertions generate invalid SQL for incremental tables in v3.0.2
Aug 12, 2024
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 .The text was updated successfully, but these errors were encountered: