Reputation: 55
I have a dim delta table so far i am calculating dim_id
using row_number() + max(dim_id)
.
Dim_id | user_id
1001 | 1
1002 | 3
1003 | 5
1004 | 9
For example if i deleted 1004 id then insert a new user_id like 7 (row_number() + max(dim_id) = 1004)
1004 id repeated. Is there any way to prevent already used ids not created once it deleted from the delta table
Upvotes: 0
Views: 411
Reputation: 96
Primary Key
, yet not support until now.monotonically_increasing_id()
with row_number()
for two columns. Here is the example: Generate unique increasing valuesRD:
Upvotes: 2