问题
The results of Athena query is saved by the query id (a long string) in S3. I was wondering if there's a way to save the results of the query with a pre-specified name? (that can later be easily looked up)
回答1:
unfortunately no (at least not yet)! the best way to do this as of now is to write a script to go through all the results of each run and rename (moving+deleting) all the files in that s3 bucket!
回答2:
For named queries your results location will be structured as follows:
s3://athena-query-results-<account>-<region>/<query-name>/<year>/<month>/<day>/<UUID>.csv
I don't know any method of specifying the UUID by the client. But you could look for the newest file within the s3 folder of your named query.
Alternatively, you could use the s3 API or the aws cli to copy the result into a location of your choice.
Does this answer your question?
来源:https://stackoverflow.com/questions/51412005/how-to-change-the-name-of-the-athena-results-stored-in-s3