Error while create a new dataset from athena

I need to create a new dataset from Athena using a personalized SQL query that joins two tables. The query executes successfully in Athena, but when I use the same query in QuickSight, it generates the error:

“Preview Failed
Failed to generate preview. Please check your data preparation steps and try again.”

When I try a simple SELECT * FROM ..., it sometimes works. For example, if I start with the simple query and then switch to my complex query (which doesn’t work), and then switch back to the simple SELECT * FROM ..., it stops working and shows the same error. I have tried referencing tables as db.tb and "db"."tb". QuickSight AI says my query is correct.

Has anyone experienced the same problem? How can I fix it?

Hi @Douglas_M_S and welcome to the Quick Community!

Based on what you have explained, I think this is less of a SQL issue and more of a quicksight dataset creation issue. Couple of things you can try:

Try creating the dataset in SPICE vs Direct Query separately and see if that changes anything. Or another option could be dependent on what data prep experience are you using. There have been some instances where other community users have noted a few unintended behaviors with the new data prep experience, but the issue resolved itself when they switched to the legacy experience.

Hi @Douglas_M_S ,
In addition to the troubleshooting steps provided above by @JacobR, I recommend filing a case with AWS Support where we can dive into the details so that we can help you further. Here are the steps to open a support case. If your company has someone who manages your AWS account, you might not have direct access to AWS Support and will need to raise an internal ticket to your IT team or whomever manages your AWS account. They should be able to open an AWS Support case on your behalf. Hope this helps!