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
preguntada hace 7 años4084 visualizaciones
2 Respuestas
0

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

xv23
respondido hace 6 años
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')

respondido hace 6 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas