dwax
dwax

Reputation: 401

How to partition a datetime column when creating Athena table

I have some log files in S3 with the following csv format (sample data in parenthesis):

userid (15678),
datetime (2017-09-14T00:21:10),
tag1 (some random text),
tag2 (some random text)

I want to load into Athena tables and partition the data based on datetime in a day/month/year format. Is there a way to split the datetime on table creation or do I need to run some job before to separate the columns and then import?

Upvotes: 1

Views: 3980

Answers (1)

Dhaval
Dhaval

Reputation: 1076

Athena supports only External tables of Hive. In external tables to partition the data you data must be in different folders.

There are two ways in which you can do that. Both are mentioned here.

Upvotes: 1

Related Questions