Skip to content

Commit c26e32b

Browse files
committed
fix timediff.py
1 parent 3c0dbfc commit c26e32b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

timediff.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
df.withColumn('input_timestamp',to_timestamp(col('input_timestamp')))\
2727
.withColumn('current_timestamp', current_timestamp().alias('current_timestamp'))\
28-
.withColumn('DiffInSeconds',current_timestamp().cast(LongType) - col('input_timestamp').cast(LongType))\
28+
.withColumn('DiffInSeconds',current_timestamp().cast(LongType()) - col('input_timestamp').cast(LongType()))\
2929
.withColumn('DiffInMinutes',round(col('DiffInSeconds')/60))\
3030
.withColumn('DiffInHours',round(col('DiffInSeconds')/3600))\
3131
.withColumn('DiffInDays',round(col('DiffInSeconds')/24*3600))\

0 commit comments

Comments
 (0)