Created
January 10, 2022 15:04
-
-
Save andreaschandra/79eeb5d67d8645c088922bdc58522a15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
import airflow | |
from airflow import DAG | |
from custom import MySqlToPostgreOperator | |
dag = DAG( | |
dag_id="a_job_near_rt", | |
start_date=datetime.now() - timedelta(hours=1), | |
schedule_interval="* * * * *", | |
concurrency=100 | |
) | |
start = MySqlToPostgreOperator( | |
task_id=f"start", | |
sql="select * from user " | |
"where created_at BETWEEN '{start_date}' " | |
"AND '{end_date}'", | |
target_table='public.user', | |
identifier='id', | |
dag=dag, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment