Notifications
Clear all

SQL to load Satellite


Posts: 149
Topic starter
(@adarsh)
Estimable Member
Joined: 2 years ago

I came across a SQL snippet to load data from stage to RDV satellite from a blog from Kent - https://www.snowflake.com/blog/tips-for-optimizing-the-data-vault-architecture-on-snowflake-part-3 /" target="true"> https://www.snowflake.com/blog/tips-for-optimizing-the-data-vault-architecture-on-snowflake-part-3/

LOAD when

WHEN (SEL COUNT(*)
FROM dv.sat_countries sc
WHERE sc.hub_country_key = stg.hash_key
AND sc.hash_diff = MD5(country_name)) = 0

 

Question is -  does it works without selecting the latest version from SAT and then comparing the HDIFFs?

There can be a scenario where two versions have same HDIFF (due correction and reverts in source system) and in that case this SQL will not load the record in the SAT.

Reply
Topic Tags
3 Replies