Skip to content

Instantly share code, notes, and snippets.

View ankit-crossml's full-sized avatar

Ankit Aggarwal ankit-crossml

View GitHub Profile
@ankit-crossml
ankit-crossml / python_athena.py
Created April 14, 2020 09:11
Medium Blog - Athena S3 - python athena example
import boto3
import time
import re
client = boto3.client('athena')
# run athen query
response = client.start_query_execution(
QueryString=athena_query,
QueryExecutionContext={'Database': ATHENA_DATABASE_NAME},
@ankit-crossml
ankit-crossml / create_table_partitions.sql
Created April 14, 2020 08:56
Medium Blog - Athena S3 - create table with partitions gist
CREATE EXTERNAL TABLE IF NOT EXISTS athena_example (
request_timestamp string,
request_ip string,
request_port int,
backend_ip string,
backend_port int,
request_processing_time double,
protocol string,
user_agent string,
ssl_protocol string )
@ankit-crossml
ankit-crossml / athena_create.sql
Last active April 14, 2020 08:52
Medium Blog - Athena S3 - create table gist
CREATE EXTERNAL TABLE IF NOT EXISTS athena_example (
request_timestamp string,
request_ip string,
request_port int,
backend_ip string,
backend_port int,
request_processing_time double,
protocol string,
user_agent string,
ssl_protocol string)