[Apache Airflow] Backfill

less than 1 minute read

Backfill

  • Data schema가 backfill이 가능한 구조여야함
    • 예를 들어 시간 단위인 경우 created, modified와 같은 날짜 column이 존재
  • Airflow 내부 변수인 execution_date를 바탕으로 코드를 작성
  • catchup=True
  • 멱등성을 충족하는 코드를 작성
# Backfill(2022-02-01부터 2022-02-01까지 모두 실행)
airflow dags backfill dag_name -s 2022-01-01 -e 2022-02-01
# execution_date은 실행날짜이므로, 실제로는 2022-01-31까지의 데이터가 처리됨