Hey there!
I am using Redash with Athena and it works great so far. Now I wanted to make redash execute the
MSCK REPAIR TABLE mydb.mytable; command (regularly). Redash executes the query, but automatically adds a a comment like this
/* Username: [email protected], Task ID: 7d6dasds21-dsa2c-47das2-a2sd7-400d4s2d270a, Query ID: 10, Queue: queries, Query Hash: dac8d6c15d934f51c2ab */
This command apparently makes the query fail with the message:
FAILED: ParseException line 1:0 cannot recognize input near '/' '*' 'Username'
I don't understand 100% why this happens. Other Athena queries work fine.
When I remove the command in AWS console, it works.
Any idea for quick fix?
I encountered the same problem and asked AWS support.
They said that Amazon Athena does not support /* */ comments for DDLs(MSCK, CREATE TABLE, etc.) at the moment and you should use -- style comments instead.
Looks like setting env var ATHENA_ANNOTATE_QUERY to false suppresses the annotation.
Seems to work. Many thanks!!
Thanks, both of you! Closing this for now.
Most helpful comment
Looks like setting env var
ATHENA_ANNOTATE_QUERYtofalsesuppresses the annotation.