Direct query: what to include in the FROM statement

Hi all,
I’m trying to import data from Athena via Direct Query: here are the details of the table I need to run the query on


The pcur table includes CUR data.
I tried to run several queries to get just the data WHERE bill_billing_period_end_date >= cast(‘2025-01-01 00:00:00.000’ as timestamp), e.g.
SELECT * FROM Athena.cur WHERE bill_billing_period_end_date >= cast('2025-01-01 00:00:00.000' as timestamp)
but got

The error says that the Schema does not exists, but still it matches the name you can see on the left.
In simple words, I would like to understand what to write in the FROM statement, considering that this table comes from a database in a catalog named Athena (and not awsdatacatalog).
I managed to successfully run the query in the form of FROM databasename.tablename for a database within the AwsDataCatalog, but not for these database in a different catalog.
image

Hello @GaBon, my initial thought is it may have something to do with the way you are casting the date in the where clause. If you remove the where statement, is it able to run the query?

If not, then it is likely an issue with how you are pointing to the table in your query or that you have not properly shared the tables in the other catalog with QuickSight. Since you do not want to show some of the query information publicly in your post, feel free to send me some screenshots in a DM of the query that is failing and the other query you are running that is working as expected. With a little more information, I can help guide you towards a solution.

1 Like

Hi @GaBon,
I see you have called in the schema directly instead of table. May be try this query instead

Select * from schema name.table name

In this scenario, It will be curr. pur

If this doesn’t work then kindly check for athena permissions under manage Quicksight section.

Thank you.

1 Like

Hello @GaBon, did any of the information shared helped resolve the issue you are facing? If not, please respond with some more information so we can help guide you towards a solution. If we do not hear back from you in 3 days, I will close out this topic. Thank you!

Hi @DylanM,
The problem is not in the WHERE statement (same issue if I remove it); therefore, I opened an internal ticket to get Admin access to Quicksight in order to check if and where I can share the tables in the other catalog. I’m waiting to get the necessary rights to resolve this.
Thanks!

1 Like

Hello @GaBon, thank you for following up! I will go ahead and archive this topic since you are waiting for more information from the support team. If you need further information after discussing the support ticket, please post a new topic in the community and link to this question to provide relevant information. That will ensure you are at the top of the priority list for a response from one of our QuickSight experts. Thank you!