Athena Query error

25 Feb 2017

Athena simply gives a message saying failed to run query with very little input as to where the query failed

An error occurred when executing the SQL command:

Failed to run query

Execution time: 0.03s
Statement 1 of 1 finished

1 statement failed.

This is not very useful for debugging. The only workaround I have found so far is to slowly remove parts of the create table statement or the query and try running the query.

In case of DDLs, here’s where I found the most problems.

  • Not using external keyword when creating a table
  • using Integer instead of Int in the table definition
  • Specifying a location that does not match the S3:// format

In case of queries, it is usually a missing comma or an additional comma at the end of a given column name or expression. And the good-old mismatch parantheses.

who am i

I am a data engineer with interests in databases, data science, algorithms and programming in general.

where am i

linkedin//rchamarthi
stackoverflow/users/237939/rchamarthi
Content available under Creative Commons (BY-NC-SA) unless otherwise noted.
This site is hosted at Github Pages and created with Jekyll. It uses the papyrus theme