spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mich Talebzadeh <mich.talebza...@gmail.com>
Subject This simple UDF is not working!
Date Fri, 25 Mar 2016 14:36:42 GMT
Hi,

writing a UDF to convert  a string into Date

def ChangeDate(word : String) : Date = {
     | return
TO_DATE(FROM_UNIXTIME(UNIX_TIMESTAMP(word),"dd/MM/yyyy"),"yyyy-MM-dd")
     | }
<console>:19: error: not found: type Date

That code to_date.. works OK in sql but not here. It is complaining about
to_date?

Any ideas will be appreciated.

Thanks,


Dr Mich Talebzadeh



LinkedIn * https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
<https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>*



http://talebzadehmich.wordpress.com

Mime
View raw message