Types of Models

You can create two types of Models in Hevo.

Non-Incremental (or Full) Models 

Full Models recreate the table at every run. This allows you to change the query without worrying about the changed table schema. Full Models do not require a primary key to locate the starting point for the updates as the table is recreated at every run based on the fields in the query. These are also refered to as Truncate and Load Models in legacy Models.

Create a Model with Incremental Model toggle Off

Incremental Models 

Incremental Models allow you to export only the changed data to the output table. This means that instead of recreating the table, you can choose to only update existing records and insert new records into the table.

Create a Model with Incremental Model toggle On

Note: There is no way to configure the existing column mappings explicitly for both types of Models. You need to add appropriate column aliases in the query to make sure the output table schema does not change when the table is getting recreated.

You can also specify the following optional inputs for the incremental Model:

  • Primary Keys to update rows: If provided, the output table is deduplicated based on the primary key. If primary keys are not provided, the data fetched for each Model run is appended to the existing output table. This feature is available in all Model versions.

  • Templated methods: A templated method can be included in the SQL query to limit the data fetched by the query to records created or updated subsequent to the last run of the Model. Otherwise, the entire list of records is fetched and from those, the Model query must locate the new and changed records for upsertion. This feature is available only in Models version 2.0.

Note: You can use only one template method in a query. You must provide appropriate primary keys on the destination table to make sure there are no duplicates.