Skip to content

Tag: amazon-athena

Query S3 from Python

I am using python to send a query to Athena and get table DDL. I am using start_query_execution and get_query_execution functions in the awswrangler package. The code above creates a dict object that stores query results in an s3 link. The link can be accessed by res[‘ResultConfiguration’][‘OutputLocation’]. It’s a text link: s3://…..txt Can someone help me figure how to access

Athena query fails with boto3 (S3 location invalid)

I’m trying to execute a query in Athena, but it fails. Code: But it raises the following exception: However, if I go to the Athena Console, go to Settings and enter the same S3 location (for example): the query runs fine. What’s wrong with my code? I’ve used the API of several the other services (eg, S3) successfully, but in