Reputation: 87
Data stored in S3 as 2021-06-01 12:00:00 is displayed as 2021-06-01 03:00:00 when queried with Athena. The column type is String. Please help me. Thank you :)
Upvotes: 0
Views: 359
Reputation: 269161
The time change is most likely due to the SQL client adjusting the time for your timezone.
You can test this with:
SELECT
the_field,
CAST(the_field AS VARCHAR)
FROM table
The second column will convert the timestamp into a string before it reaches your SQL client, so no timezone conversion will be applied. If the two columns are different, it is an indication that the time shift is being caused outside of Amazon Athena, inside your SQL client.
Upvotes: 1