Resolved! How can I add a duration in milliseconds to a timestamp?
Let's say I have a DataFrame with a timestamp and an offset column in milliseconds respectively in the timestamp and long format. E.g.from datetime import datetime df = spark.createDataFrame( [ (datetime(2021, 1, 1), 1500, ), (dat...
- 15267 Views
- 4 replies
- 3 kudos
Latest Reply
Although @Lakshay Goel​'s solution works, we've been using an alternative approach, that we found to be a bit more readable:from pyspark.sql import Column, functions as f def make_dt_interval_sec(col: Column): return f.expr(f"make_dt_interval...
- 3 kudos