Skip to content

Instantly share code, notes, and snippets.

View thiagodiogo's full-sized avatar
😀
Provable privacy = Math applied to privacy

Thiago Diogo thiagodiogo

😀
Provable privacy = Math applied to privacy
  • São Paulo, Brazil
View GitHub Profile
@schledererj
schledererj / fetchall_athena.py
Created February 19, 2018 19:09
Using boto3 and paginators to query an AWS Athena table and return the results as a list of tuples as specified by .fetchall in PEP 249
# Does NOT implement the PEP 249 spec, but the return type is suggested by the .fetchall function as specified here: https://www.python.org/dev/peps/pep-0249/#fetchall
import time
import boto3
# query_string: a SQL-like query that Athena will execute
# client: an Athena client created with boto3
def fetchall_athena(query_string, client):
query_id = client.start_query_execution(
QueryString=query_string,