Amazon Athena: no viable alternative at input

Unfortunately, at the moment the syntax validation error messages are not very descriptive in Athena, this error may mean "almost" any possible syntax errors on the create table statement.

Although this is annoying at the moment you will need to check if the syntax follows the Create table documentation

Some examples are:

  • Backticks not in place (as already pointed out)
  • Missing/extra commas (remember that the last column doesn't need the comma after column definition
  • Missing spaces
  • More ..

hyphens are not allowed in table name.. ( though wizard allows it ) .. Just remove hyphen and it works like a charm


This error generally occurs when the syntax of DDL has some silly errors.There are several answers that explain different errors based on there state.The simple solution to this problem is to patiently look into DDL and verify following points line by line:-

  1. Check for missing commas
  2. Unbalanced `(backtick operator)
  3. Incompatible datatype not supported by HIVE(HIVE DATA TYPES REFERENCE)
  4. Unbalanced comma
  5. Hypen in table name