There are a few staging models where there is a where clause within the first CTE before the fill_staging_columns macro is created.
This can cause errors if the field in the where clause is not in the source table. See here for an example of this error.
Relevant error log or model output
15:24:45 Database Error in model stg_hubspot__contact_list_member (models/stg_hubspot__contact_list_member.sql)
15:24:45 column "_fivetran_deleted" does not exist
15:24:45 LINE 12: where not coalesce(_fivetran_deleted, false)
Expected behavior
The staging model leverages the fill_staging_columns macro to pass a null record in when the field does not exist in the source table.
Is there an existing issue for this?
Describe the issue
There are a few staging models where there is a
where
clause within the first CTE before the fill_staging_columns macro is created.This can cause errors if the field in the where clause is not in the source table. See here for an example of this error.
Relevant error log or model output
Expected behavior
The staging model leverages the fill_staging_columns macro to pass a
null
record in when the field does not exist in the source table.dbt Project configurations
N/A
Package versions
packages:
What database are you using dbt with?
postgres, redshift, snowflake, bigquery, databricks
dbt Version
Additional Context
No response
Are you willing to open a PR to help address this issue?