Can I use the ID of my saved query to start query execution in Athena SDK?


For Athena's SDK, is there a way to start the query execution using the ID of my saved query (NOT the execution ID). I'm currently using Java and Python (boto3), and I'm wondering if there is a functionality that takes the saved query's ID as input and starts the query execution?

For example. I want something in Python as follows:

athena_client = boto3.client('athena')
response_query_execution_id = athena_client.start_query_execution( 
        QueryID='the ID of my saved query'
asked 2 years ago491 views
1 Answer


I am afraid to inform you that start query execution accepts query-string only, it does not accept execution id. Basically start query execution return a query execution id which states query successfully submitted to Athena. Having said that there is not any direct way to start query execution using execution id.

You can consider one approach like use get-query-execution with query id which returns query string and pass this query string in start-query-execution.

aws athena get-query-execution --query-execution-id 

aws athena start-query-execution --query-string
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions