Athena does not recognize date functions

0

Hi,

I have date in one of the table columns in the format "8/14/2017". I get an error when I use the function from_unixtime to convert it into ISO time date.

The query I am using is

select TO_DATE(from_unixtime(UNIX_TIMESTAMP('07/03/2013', 'yyyy-mm-dd')))

The following is the error:: Can you please take a look at this

Your query has the following error(s):
SYNTAX_ERROR: line 1:30: Function unix_timestamp not registered

thanks,
sharu

Edited by: SSharu on Oct 17, 2017 11:44 PM

SSharu
demandé il y a 7 ans4084 vues
2 réponses
0

I have this same problem. Does anybody have an answer?

xv23
répondu il y a 6 ans
0

Not sure if these just renamed since you tried but unix_timestamp is not listed on the date functions in Presto - https://prestodb.io/docs/current/functions/datetime.html - you could do to_unixtime though but it takes a timestamp. Given the original query the unixtime stuff looks unnecessary, you could just use date_parse e.g. date_parse('07/03/2013', 'yyyy-mm-dd')

répondu il y a 6 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions