is_incremental and this

The is_incremental() function returns true when the model already exists and is not being fully rebuilt. It is used to add a filter that limits the query to new data, for example by comparing with the maximum of the target table, designated by {{ this }}.

Example

{% if is_incremental() %}
where maj > (select max(maj) from {{ this }})
{% endif %}

Related concepts

The whole glossary