What would be the best approach to inspect the SQL generated by QuickSight?

We’re using QuickSight on top of Athena (where we keep our data). Lots of our engineers are used to directly query on Athena and have SQL snippets ready to go. We’re currently migrating much of that to QuickSight dashboards but we see different results; The main issue is that this is hard to debug. We can lookup the SQL statements in the Athena logs but this is cumbersome (requires some heuristics plus in hour case this happens in a multi-account setup). I really miss a QuickSight feature that just shows this is the SQL we will run. I’m very interested to hear the opinions in this community. Thanks!

Hi @pieterjan -

One approach is to use the QuickSight API to describe DataSets. The response will have any custom SQL used as well as join operations within the data prep.

Using that approach you can iterate through all the DataSet responses and dump the custom SQL queries into a s3 bucket, etc.

1 Like

Usually i add a comment at the beginning of the custom sql query which would help me uniquely identify for the query in Athena’s Recent Query. Like so:

/* MyQuery-20220101 */

Then I search for that text in Athena’s Recent Queries page to get the final query that is executed by QuickSight.

1 Like