<@U04S8PLJWMT> in a full refresh - append extracti...
# ask-ai
j
@kapa.ai in a full refresh - append extraction, how to know the last batch of extracted data?
k
In a Full Refresh - Append extraction in Airbyte, you can identify the last batch of extracted data by using the
_airbyte_emitted_at
timestamp column that Airbyte automatically adds to your destination tables. According to the [Full Refresh - Append documentation](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/full-refresh-append), each sync appends all data from the source to the destination table. The
_airbyte_emitted_at
field contains the timestamp when each record was emitted during a sync, allowing you to distinguish between different sync batches. For example, as shown in the [tutorial on full refresh data synchronization](https://airbyte.com/tutorials/full-data-synchronization#step-8), after multiple syncs, you can query your destination table and see records grouped by their
_airbyte_emitted_at
timestamps:
Copy code
sql SELECT * FROM _airbyte_raw_append_full_refresh_demo;
This would show records with different
_airbyte_emitted_at
values, where records with the most recent timestamp represent the last batch of extracted data. Additionally, if you're using Refresh Syncs, Airbyte provides a
_airbyte_generation_id
column that tracks data generations. As explained in the [refreshes documentation](https://docs.airbyte.com/platform/operator-guides/refreshes#data-generations), this monotonically increasing counter increments with each refresh sync, making it easier to identify which batch of data belongs to which sync operation. To find the last batch, you can query for the maximum
_airbyte_emitted_at
timestamp or the highest
_airbyte_generation_id
value in your destination table.
j
so, Airbyte should stop emitting a record if it was deleted, right?
@kapa.ai so, Airbyte should stop emitting a record if it was deleted, right?
k
A message from kapa.ai
Not exactly. The behavior depends on the sync mode you're using in Airbyte: ## Full Refresh - Overwrite With Full Refresh - Overwrite, deleted records will not appear in the destination because this mode replaces all data in the destination with the current state of the source. As explained in the [full refresh data synchronization tutorial](https://airbyte.com/tutorials/full-data-synchronization#step-2), "data that has been deleted from the source will also be deleted in the destination." ## Full Refresh - Append With Full Refresh - Append, Airbyte will stop emitting a deleted record in subsequent syncs, but previous copies remain in the destination. According to the [Full Refresh - Append documentation](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/full-refresh-append), you can detect deletions by examining the batch ID or
_airbyte_emitted_at
timestamp - if a record doesn't appear in the latest batch, it was likely deleted from the source. The [refreshes documentation](https://docs.airbyte.com/platform/operator-guides/refreshes#example-discovering-deletes-from-a-source-that-hides-them) provides a specific example: if a record's latest entry doesn't belong to the current generation (e.g.,
max(_airbyte_generation_id)
), this indicates the source no longer includes that record. ## Incremental Sync With Incremental Sync modes, deleted records are not propagated to the destination at all. As noted in the [incremental data synchronization tutorial](https://airbyte.com/tutorials/incremental-data-synchronization#step-7), "the deletion has not been, and will not be, propagated to the destination" because incremental syncs only query for records that have been inserted or modified since the last sync. ## Solutions for Tracking Deletes To properly handle deletions, you can: 1. Use CDC (Change Data Capture) if your source supports it - this will flag deleted records in the destination 2. Use Full Refresh - Overwrite to mirror the source exactly 3. Implement soft deletes in your source system As mentioned in a [forum discussion](https://discuss.airbyte.io/t/372), REST API sources typically cannot detect deletions unless they expose a deleted status field, which is uncommon.