Re: getting null when calculating time diff with unix_timestamp + spark 1.6

2016-07-22 Thread Jacek Laskowski
Hi, It appears that lag didn't work properly, right? I'm new to it, and remember that in Scala you'd need to define a WindowSpec. I don't see one in your SQL query. Pozdrawiam, Jacek Laskowski https://medium.com/@jaceklaskowski/ Mastering Apache Spark http://bit.ly/mastering-apache-spark

getting null when calculating time diff with unix_timestamp + spark 1.6

2016-07-20 Thread Divya Gehlot
Hi, val lags=sqlContext.sql("select *,(unix_timestamp(time1,'$timeFmt') - lag(unix_timestamp(time2,'$timeFmt'))) as time_diff from df_table"); Instead of time difference in seconds I am gettng null . Would reay appreciate the help. Thanks, Divya