Skip to content

Instantly share code, notes, and snippets.

@mrshu
Last active June 20, 2019 16:35
Show Gist options
  • Save mrshu/d8783cf8a60c6b11536f487f31141a65 to your computer and use it in GitHub Desktop.
Save mrshu/d8783cf8a60c6b11536f487f31141a65 to your computer and use it in GitHub Desktop.
Simple Athena Query
from airflow.models import DAG
from airflow.contrib.operators.aws_athena_operator import AWSAthenaOperator
from datetime import datetime
with DAG(dag_id='simple_athena_query',
schedule_interval=None,
start_date=datetime(2019, 5, 21)) as dag:
run_query = AWSAthenaOperator(
task_id='run_query',
query='SELECT * FROM UNNEST(SEQUENCE(0, 100))',
output_location='s3://my-bucket/my-path/',
database='my_database'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment