amazon-web-servicesamazon-athenaaws-lake-formation

Athena Query fails after adding S3 bucket to Lake Formation



Solution

  • Contacted AWS support. Turns out the problem was that I had "-" and "." in my Athena database name. According to Athena documentation:

    "The only acceptable characters for database names, table names, and column names are lowercase letters, numbers, and the underscore character." (https://docs.aws.amazon.com/athena/latest/ug/glue-best-practices.html#schema-names)

    For some reason this was not a problem when we were working outside the Lake Formation, but as soon as we registered the S3 location in LF, it started failing. I have confirmed that removing those characters from the database name solves the problem.