Macro Processing is critical to implementing DRY patterns, simplifying query writing, and enabling dynamic query generation.

SDF supports two types of macros:

  1. Jinja Macros - Similar to other frameworks like DBT and Airflow, SDF supports Jinja macros for templating and dynamic query generation.
  2. SDF Variables - Modeled after SQL Variables common in SQL dialects like BigQuery, SDF supports SQL Variables for parameterizing queries. SDF variables can be used anywhere as SQL variables or Jinja variables

Both of these are preprocessed before compilation and execution.

To get familiar with Jinja templating, check out our Introduction to Jinja guide.