Skip to content

Athena date_parse week format bug

1

I cannot retrieve the date of the week 1 of 2025 when querying in athena. Please consider the below queries. I commented the value I'm getting on each expression.

select
    date_parse('2025-1', '%Y-%v') as date_of_2025_1, -- 2025-12-29 00:00:00.000
    date_parse('2024-1', '%Y-%v') as date_of_2024_1, -- 2024-01-01 00:00:00.000
    date_parse('2024-52','%Y-%v') as date_of_2024_52, -- 2024-12-23 00:00:00.000
    -- date_parse('2024-53','%Y-%v') as 'date of 2024-53' -- doesn't compile
    week(date_parse('2024-12-30', '%Y-%m-%d')) as week_of_2024_12_30 -- 1

Surely, date_parse('2025-1','%Y-%v') should not return the date 2025-12-29?

asked 2 years ago119 views

1 Answer
0

I would recommend opening a support case on this.

AWS
EXPERT

answered 2 years ago

EXPERT

reviewed 2 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.