amazon web services - AWS Athena date_Part -
i'm trying truncate date day using athena. here's input , select statement like:
create table ... usagestartdate timestamp, usageneddate timestamp, ... row format serde 'org.apache.hadoop.hive.serde2.lazy.lazysimpleserde' serdeproperties ( 'serialization.format' = ',', 'field.delim' = ',', "timestamp.formats" = "yyyy-mm-dd't'hh:mm:ss.sssss'z'") location 's3: day select... resource string day(usagestartdate) sum(usagehours)
to retrieve date of timestamp column need use datetime functions underlying prestodb engine.
so resulting select this:
select date(usagestartdate) date, date_diff('hour',usagestartdate,usageenddate) hours usagetable
Comments
Post a Comment