Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon Athena: no viable alternative at input

While creating a table in Athena; it gives me following exception:

no viable alternative at input

like image 554
Deepak Singhal Avatar asked Dec 01 '16 13:12

Deepak Singhal


2 Answers

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

like image 142
Deepak Singhal Avatar answered Oct 21 '22 21:10

Deepak Singhal


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 ..
like image 30
esalgado Avatar answered Oct 21 '22 22:10

esalgado