spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacek Laskowski <ja...@japila.pl>
Subject Re: write and call UDF in spark dataframe
Date Thu, 21 Jul 2016 07:13:13 GMT
On Thu, Jul 21, 2016 at 5:53 AM, Mich Talebzadeh
<mich.talebzadeh@gmail.com> wrote:
> something similar

Is this going to be in Scala?

> def ChangeToDate (word : String) : Date = {
>   //return
> TO_DATE(FROM_UNIXTIME(UNIX_TIMESTAMP(word,"dd/MM/yyyy"),"yyyy-MM-dd"))
>   val d1 = Date.valueOf(ReverseDate(word))
>   return d1
> }
> sqlContext.udf.register("ChangeToDate", ChangeToDate(_:String))

then...please use lowercase method names and *no* return please ;-)

BTW, no sqlContext as of Spark 2.0. Sorry.../me smiling nicely

Jacek

---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscribe@spark.apache.org


Mime
View raw message