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
dbt.concat does not handle the Snowflake null element case very well (more details here and could be rebuilt with our own macro to do so.
Currently the coalesce_cast macro is applied at the intermediate layer, which is non-standard--usually casting and coalescing would happen at the staging layer to reduce macro operations. This can lead to some of the base tables being coalesce_cast'ed at multiple intermediate models (like user_name and created_by in Zendesk) when it could just be cast in the staging layer once.
We do bring in a '1970-01-01 00:00:00.00' timestamp value for non-null cases in our coalesce_cast for timestamp values like created_time, which could lead to some confusion in the data if brought in. It'd be useful to figure a way to bring this value in as a similar UNKNOWN without specific
How would you implement this feature?
Early thoughts:
we can create a custom dbt.concat macro that handles the snowflake null case we solved for.
We can explore bringing the macro upstream and apply it at the staging layer and see if it causes any issues.
Casting the timestamp value to string within coalesce_cast and bringing the original timestamp value downstream for any additional operations it's needed for.
Describe alternatives you've considered
No response
Are you interested in contributing this feature?
Yes.
Yes, but I will need assistance.
No.
Anything else?
No response
The text was updated successfully, but these errors were encountered:
fivetran-avinash
changed the title
[Feature] Further macro optimizations for dbt.concat and coalesce_cast
[Feature] Further macro optimizations and potential refactoring of dbt.concat and coalesce_castJan 29, 2025
Is there an existing feature request for this?
Describe the Feature
Several issues
dbt.concat
does not handle the Snowflake null element case very well (more details here and could be rebuilt with our own macro to do so.Currently the
coalesce_cast
macro is applied at the intermediate layer, which is non-standard--usually casting and coalescing would happen at the staging layer to reduce macro operations. This can lead to some of the base tables beingcoalesce_cast
'ed at multiple intermediate models (likeuser_name
andcreated_by
in Zendesk) when it could just be cast in the staging layer once.We do bring in a '1970-01-01 00:00:00.00' timestamp value for non-null cases in our coalesce_cast for timestamp values like
created_time
, which could lead to some confusion in the data if brought in. It'd be useful to figure a way to bring this value in as a similar UNKNOWN without specificHow would you implement this feature?
Early thoughts:
dbt.concat
macro that handles the snowflake null case we solved for.coalesce_cast
and bringing the original timestamp value downstream for any additional operations it's needed for.Describe alternatives you've considered
No response
Are you interested in contributing this feature?
Anything else?
No response
The text was updated successfully, but these errors were encountered: