Quando eseguo un'istruzione MSCK REPAIR TABLE o SHOW CREATE TABLE in Amazon Athena, ricevo un errore simile al seguente: "FAILED: ParseException line 1:# missing EOF at '-' near 'keyword'".
Risoluzione
Se il nome del database specificato nell'istruzione DDL contiene un trattino ("-"), ricevi un errore ParseException. Sebbene AWS Glue consenta nomi di database con trattini, Athena non li consente. Il trattino basso ("_") è l'unico carattere speciale supportato da Athena nei nomi di database, tabelle, viste e colonne.
Nell'esempio seguente, il nome del database, alb-database1, contiene un trattino. Quando esegui la query MSCK REPAIR TABLE o SHOW CREATE TABLE, Athena restituisce il seguente errore ParseException:
"Your query has the following error(s):
FAILED: ParseException line 1:7 missing EOF at '-' near 'alb'
This query ran against the "alb-database1" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: cc5c1234-4c12-4dcb-a123-bff954b305eb."
Per risolvere il problema, ricrea il database con un nome che non contenga caratteri speciali, ad eccezione del trattino basso.