Is it better to have a surrogate key or nk+effective_time in dimension tables in apache hive
- 阅读更多 关于 Is it better to have a surrogate key or nk+effective_time in dimension tables in apache hive
问题 Lets say, there is a SCD2 dimension table - location. The natural key is country, state and city combined. Since it is SCD2 table, eff date is also part of the key. Is it better to have the surrogate key as usavirginarichmond20110101 or create an actual numerical key using row_number() in hive? Why one approach is better over another? 回答1: (Note on terminology: combination of natural keys is called "composite key", not surrogate key, and it's still a "natural key". Surrogate key (aka