Learn how to use sql_header and set_sql_header in Y42 to execute statements within the same session of your asset.
SQL headers allow you to manipulate the current session settings, such as roles and timezones, directly within your asset's run session.
You can define SQL headers directly in the SQL file's config block, within YAML configs, or in the
Example in a Snowflake SQL asset:
Example in dbt_project.yml:
set_sql_header macro offers a convenient way to inject multi-line SQL statements without using the
sql_header configuration key. It simplifies the inclusion of complex session manipulations directly within your asset definitions.