I'm trying to run a query in Athena where the latest event date is the only row that gets returned. Initially, I'm first trying to parse the event date from a string (Partitioned) to yyyy/mm/dd. After that, I want to pull ONLY the MAX() or latest event date details.
Here's what I currently have and the error I'm getting
select CAST(date_parse(eventdate,'%yyyy/%mm/%dd')AS date)
INVALID_FUNCTION_ARGUMENT: Invalid format: "20221204" is malformed at "221204"