How can I find the Query ID for an Athena Saved Query on AWS console?
After I create a query in Athena using the AWS console, how can I find the Query ID associated with that query?
If I run the query and it fails, I can see the Query ID in the AWS console by going to "Recent Queries" and clicking the "Failed" link next to the query run (https://docs.aws.amazon.com/athena/latest/ug/querying.html), but this doesn't work for queries where the status is "completed".
I can also use the API to first call ListNamedQueries, then iterate through that resulting list of query ids and call GetNamedQuery on each one to see if the name matches the query I'm looking for. But that's a really roundabout process just to get the query id for a query I just created.
Is there another way to simply find a named query's id via the console that I'm not seeing?
No, I'm not looking for the Execution Id. That would be the id for a query run. I'm looking for a way to find the NamedQueryId for a Named Query from console.
Thank you for the clarification, could you also let me know how you want to use the Named query ID?
As mentioned the NamedQueryId is different from the QueryId (in the Recent Queries tab for Failed execution query id = execution id).
in the Saved Queries tab, you can see all the Named query in the workspace you are using, that tab shows the Actual Name of the query , the SQL and the description.
the only thing missing is the database and the Named query Id itself, https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/athena.html#Athena.Client.get_named_query
based on the documentation link you shared I think that the id you are looking for is the
**Execution Id** . If want to check click on the failed query and look at the Query Id you will see it should match the execution id.
hope this helps,
How can I find the Query ID for an Athena Saved Query on AWS console?asked 4 months ago
Athena - Execute multiple query and capture output in a file on e2asked a month ago
ErrorCode: INTERNAL_ERROR_SERVICEasked 8 days ago
Athena permission error running a queryasked 3 months ago
GENERIC_USER_ERROR for Athena + Dynamodbasked 25 days ago
Can we add column to an existing table in AWS Athena using SQL query?Accepted Answerasked 3 years ago
I cannot use current_date + interval in Athena boto3 query in LambdaAccepted Answerasked 3 months ago
Can i execute an Athena saved query from lambda?Accepted AnswerMODERATORasked 3 years ago
Athena Query timeoutasked 5 days ago
AWS Data Wrangler Athena Query FailureAccepted Answerasked 4 months ago