uuid in Merge
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 01:58 PM
Hi guys,
I'm trying to use uuid in the merge but I always get an error...
import uuid
(
df_events.alias("events").merge(
source = df_updates.alias("updates"),
condition = "events.cod = updates.cod and events.num = updates.num"
).whenMatchedUpdate(
set =
{
"events.cod" : "updates.cod",
"events.num_c" : "updates.num_contrato",
"events.status": lit("Updated")"
}
).whenNotMatchedInsert(values =
{
"events.id" : uuid.uuid4(),
"events.cod" : "updates.cod",
"events.num" : "updates.num",
"events.status" : lit("Inserted")
}
)
.execute()
)have any tips ?
Labels:
- Labels:
-
Uuid