title: How to parameterize SQL in airflow based on its run schedule
body: <p>In airflow, we can perform SQL operations in databases like MySQL, PostgreSQL or cloud database like BigQuery.</p>
  <p>We can also pass the parameter using user_defined_macros in SQL which will replace it with certain values. Eg. parameterize the database/schema name to avoid 2 different versions of sql w.r.t Dev/QA/Prod environment.</p>
  <p>However, is there any way using which we can further optimize it for different schedule provided SQL's are same.</p>
  <p>Eg.</p>
  <p>For regular run use table : Dev_A/QA_A/Prod_A</p>
  <p>For snapshot run use table : Dev_B/QA_B/Prod_B</p>
  <p>This will help us to avoid 2 different versions of SQL for regular and snapshot run.</p>