Looks like you forgot an import for Date.

FYI

On Fri, Mar 25, 2016 at 7:36 AM, Mich Talebzadeh <mich.talebza...@gmail.com>
wrote:

>
>
> 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
>
>
>

Reply via email to