spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tal Rozen <...@scaleka.com>
Subject Timestamp functions for sqlContext
Date Tue, 21 Jul 2015 16:04:10 GMT
Hi,

I'm running a query with sql context where one of the fields is of type
java.sql.Timestamp. I'd like to set a function similar to DATEDIFF in
mysql, between the date given in each row, and now. So If I was able to use
the same syntax as in mysql it would be:

val date_diff_df = sqlContext.sql("select DATEDIFF(curdate(), rowTimestamp)
date_diff from tableName")

What are the relevant key words to replace curdate(), and DATEDIFF?

Thanks

Mime
View raw message