How to cast timeUUID to timestamp in PySpark/Python?

262 views Asked by At

I have a column named "occurance" which is a timeuuid in the string form. I want to to be converted/cast to timestamp. I tried couple of methods but couldn't get through it.

enter image description here

from uuid import *
import time_uuid

my_uuid = uuid.UUID(occurrence)
ts = time_uuid.TimeUUID(bytes=my_uuid.bytes).get_timestamp()

But gives this error below: enter image description here

0

There are 0 answers