Incremental refreshes keep transformation outputs current by re-processing only the data affected by recent changes. For large datasets, this can shorten refresh times and reduce compute usage, making frequent refreshes more efficient.
Incremental refreshes are most beneficial when the majority of the dataset stays unchanged between refreshes and the affected portion can be identified reliably.
Incremental refreshes only support Big object outputs. Custom object and Live object outputs are not currently supported.
Requirements
- Permission to create transformations.
Define your query
Start with the query that produces your complete intended dataset. Its saved output is also called the target. A full refresh rebuilds that output; an incremental refresh uses your query to select the rows or groups to reprocess.
Run the full-refresh query
Write the base query that returns the complete dataset.
Example:
Check pull request status. Each pull request has a stable id, a current state, and a last_modified_at timestamp that updates whenever the record changes.
SELECT
source.id,
source.state,
source.last_modified_at
FROM rippling.githubpullrequest.githubpullrequest AS source
Expected outcome:
- This returns one row per pull request. When adapting it, replace the source name and output columns with your own. Keep a stable row identifier and a timestamp that reliably captures relevant source changes.
- Existing statuses are updated.
Use LAST_REFRESHED() as a watermark
A watermark is a checkpoint your query uses to decide which data to reprocess. LAST_REFRESHED() takes no arguments and returns the completion time of the published transformation's last successful refresh, in UTC.
The template block {% if is_incremental() %} ... {% endif %} includes its SQL only during an incremental refresh. A full refresh skips the block and reads the complete dataset instead.
SELECT
source.id,
source.state,
source.last_modified_at
FROM rippling.githubpullrequest.githubpullrequest AS source
{% if is_incremental() %}
WHERE source.last_modified_at >= LAST_REFRESHED() - INTERVAL '48' HOUR
{% endif %}
Expected outcome:
- A full refresh reads every pull request.
- An incremental refresh reads records modified since 48 hours before the previous successful refresh completed.
Set a lookback window
A lookback window starts processing before the watermark so delayed changes are captured (in the example above, 48 hours). The inclusive >= also reprocesses records exactly at the boundary.
Choose a lookback window tailored to your source. It must cover ingestion delays, differences between source clocks, and the duration of the previous refresh. For example, a refresh completing at 10:00 might miss a change made at 09:55 while the job was running.
Because there is no strict platform guarantee that all source events up to a timestamp have arrived, choose a conservative window. Changes arriving outside your chosen window require a wider lookback, a change log, or a full refresh.
Optional: Derive a watermark from the saved output
Use a CROSS JOIN when a refresh completion time is not the checkpoint you need. For example, when a refresh finishes at 10:00 but the latest source timestamp in its saved output is 09:30 (LAST_REFRESHED() returns 10:00, whereas MAX(last_modified_at) returns 09:30).
{{ this }} refers to the transformation's saved output and is supported only inside an incremental block:
SELECT
source.id,
source.state,
source.last_modified_at
FROM rippling.githubpullrequest.githubpullrequest AS source
{% if is_incremental() %}
CROSS JOIN (
SELECT MAX(last_modified_at) AS max_last_modified_at
FROM {{ this }}
) AS watermark
WHERE (
watermark.max_last_modified_at IS NULL
OR source.last_modified_at >= watermark.max_last_modified_at - INTERVAL '48' HOUR
)
{% endif %}
Expected outcome:
- A full refresh reads every pull request.
- An incremental refresh reads from 48 hours before the maximum timestamp already stored. If that maximum is null, the
IS NULLbranch reads the complete source selection.
Choose an incremental mode
While the query decides which data to return, the incremental mode decides how those results update the saved output. Choose your mode before finalizing your query, because each mode expects different rows back:
| Mode | Use when | Data the query returns | Example key |
|---|---|---|---|
| Merge | Individual records have stable identifiers and can be updated independently. Ideal when updating individual records identified by unique keys. | New and changed output rows. | id identifies one pull request. |
| Delete + insert | A complete group needs to be recalculated, including changes to the rows belonging to it. Ideal when replacing entire groups of rows, where the configured key (such as month) is shared by multiple records. | Every current row in each affected group. | snapshot_month identifies a month of transactions. |
Merge
For the previous pull request examples, select Merge and id. A result with an existing ID updates that saved row, while a new ID inserts a row. Each ID should identify one row in both the query result and saved output.
Example:
Pull request A changes from open to closed, and pull request B is created. Returning A and B updates A and adds B, while all other saved pull requests remain unchanged.
Delete + insert
Use Delete + insert when replacing entire groups of rows at once.
Example:
A transaction source contains snapshot_month (a month-start date), transaction_id, and amount, and several transactions share a month. Choose Delete + insert and snapshot_month to replace recent monthly groups with their complete current contents.
SELECT
source.snapshot_month,
source.transaction_id,
source.amount
FROM source_transactions AS source
{% if is_incremental() %}
WHERE source.snapshot_month >= LAST_REFRESHED() - INTERVAL '90' DAY
{% endif %}
Expected outcome:
- A full refresh reads every month.
- An incremental refresh returns all current transactions for months starting on or after the cutoff (90 days before the last successful refresh completed).
- Each month present in those results is replaced in full, while earlier months remain untouched.
Identifier columns
When publishing in the Rippling UI, the Identifier columns setting selects the output columns used to match existing data:
- Merge: The selected columns together must uniquely identify each row in both the query result and saved output.
- Delete + insert: The selected columns identify a replacement group and may be shared by multiple rows. The query must return every current row in each affected group.
Selecting multiple columns matches on their combined values. For example, account_id and snapshot_month together identify each account's monthly group.
Both modes require at least one identifier column from the query output. Every selected column must be non-null in both the incremental result and the saved output.
Publish & configure
With the query, mode, and keys finalized, configure and publish the transformation:
- Click Publish, confirm the transformation information, and complete query validation.
- In Choose transformation output, select Big object and click Continue. Complete field-type configuration.
- In Configure incrementality, choose Merge for individual records or Delete + insert for complete groups.
- Under Identifier columns, select the output columns that identify each row (Merge) or each replacement group (Delete + insert).
- Review the settings and click Publish.
Initialize & validate
- Keep a full-refresh baseline: When migrating an existing transformation, retain the original and create a separate incremental copy for comparison.
- Complete an initial full refresh: Ensure the incremental copy's initial full refresh succeeds before relying on incremental runs. When no saved output exists, the system runs the full form of your query to populate the target and initialize
LAST_REFRESHED(). - Compare subsequent results: After incremental runs complete, compare row identifiers and field values against the full-refresh baseline (matching row counts alone is insufficient). Compare equivalent source data where possible, as changes arriving between runs can cause temporary differences.
- Measure performance: Compare refresh runtimes after verifying correctness. Reading less data does not always make a query faster; joins, aggregations, and replacing large groups can limit improvements. Switch to the incremental version only when both its results and runtime meet your requirements.
- Check representative changes: Use a test source or naturally occurring updates to verify the expected behaviors below:
| Change to check | Expected outcome |
|---|---|
| A new record is created. | Appears after a refresh that selects it. |
| An existing record is updated. | Saved values update when the query selects that row or its complete group. |
| A record arrives late (within lookback). | Included on a subsequent refresh. |
| A source record is deleted or stops matching. | Merge retains the saved row. Delete + insert removes it when the query returns its group's complete remaining contents. |
| An entire group becomes empty. | Delete + insert retains that group's old rows because no replacement key is returned. A full refresh is required to remove them. |
Troubleshooting
| Issue | What to check |
|---|---|
| The incremental settings are missing. | Confirm access is enabled, the query contains an incremental block, the output is Big object, and the refresh schedule is supported. |
| Recent changes are missing. | Check the successful-refresh checkpoint, source timestamp and time zone, lookback, and changes in joined sources. Widen the window or use a full refresh to recover changes outside it. |
| Rows disappear after Delete + insert. | Check that the query returns complete groups, not only the changed rows within them. |
| Duplicates or unexpected updates appear. | For Merge, check that keys identify one row. Check for null keys and joins that multiply rows. A cross-joined checkpoint aggregate should return one row. |
| Refreshes are not faster. | Check how much data the incremental filter actually avoids reading and recomputing. Joins, aggregation, and replacing large groups can limit the improvement. |