We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c0dbfc commit c26e32bCopy full SHA for c26e32b
timediff.py
@@ -25,7 +25,7 @@
25
26
df.withColumn('input_timestamp',to_timestamp(col('input_timestamp')))\
27
.withColumn('current_timestamp', current_timestamp().alias('current_timestamp'))\
28
- .withColumn('DiffInSeconds',current_timestamp().cast(LongType) - col('input_timestamp').cast(LongType))\
+ .withColumn('DiffInSeconds',current_timestamp().cast(LongType()) - col('input_timestamp').cast(LongType()))\
29
.withColumn('DiffInMinutes',round(col('DiffInSeconds')/60))\
30
.withColumn('DiffInHours',round(col('DiffInSeconds')/3600))\
31
.withColumn('DiffInDays',round(col('DiffInSeconds')/24*3600))\
0 commit comments