I\'ve been tasked with moving a lot of T-SQL into Spark (Databricks). The procedures I\'m converting are creating surrogate keys in a somewhat typical manner for BI. What I\