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
posta 7 anni fa4075 visualizzazioni
2 Risposte
0

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

xv23
con risposta 6 anni fa
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')

con risposta 6 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande