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
asked 7 years ago4025 views
2 Answers
0

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

xv23
answered 6 years ago
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')

answered 6 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions