WITH keyword direct query vs spice

Hello everyone, does anyone know if WITH keyword works with direct query + custom SQL for Athena data source?
I have a dataset that uses WITH keyword and when I tried to switch it to direct query (to use dataset parameters), it just gives the following error in my Analysis without any change to the SQL
But when I switch back to SPICE, the data will load fine.

Thank you

Hello @tsaiw,

Athena supports with statements when called from QuickSight

it is possible that there is something different than this that is causing the error. Can you show us the output of the “Show Details” to see if we get more information on the error?

@andress007, thanks for getting back to me.

My dataset shows the correct data as well. However, when used in Analysis, it shows the below error

@tsaiw ,

Analyse how much time the SQL requires to execute in Athena for the corresponding visual. If the SQL takes more than 2 minutes to complete, QuickSight will timeout . If that is the case , load the data into SPICE and use it as the source for your dashboard . Else optimize the data model , you could start with Top 10 Performance Tuning Tips for Amazon Athena | AWS Big Data Blog

1 Like