Redash: Automatically adding a comment to an Athena query provokes an error

Created on 19 Mar 2018  路  4Comments  路  Source: getredash/redash

Issue Summary

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?

Technical details:

  • Redash Version: Redash 3.0.0+b3134
  • Browser/OS: Chrome 64 / OS X
  • How did you install Redash: Via AMI Image
Bug

Most helpful comment

Looks like setting env var ATHENA_ANNOTATE_QUERY to false suppresses the annotation.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings