Airbyte performs a process sometimes referred to as a "soft reset" where it drops and re-creates the final table produced by a sync. This process is done as transactionally as possible and should be invisible to most observers. The reasons for this include schema migrations and transactional full refreshes. During a refresh or reset, Airbyte erases the raw tables and then builds a new temporary final table first. It then attempts to do an atomic swap of the old and temporary final tables, usually via a rename at the last second. This is done to avoid a period where the final table is empty, which could cause downstream issues [[source](
https://docs.airbyte.com/using-airbyte/core-concepts/typing-deduping#on-final-table-re-creation)]. In the case of BigQuery, the cleanup process involves deleting the target table and then creating a new one. For example, the
BigQueryGcsOperations
class has methods like
truncateTableIfExists
,
dropTableIfExists
, and
createTableIfNotExists
that are used for this purpose [[source](
https://github.com/airbytehq/airbyte/issues/34934)]. However, it's important to note that any additional permissions, constraints, views, or other rules you apply to the final table outside of Airbyte could be lost during a sync. It's recommended not to alter the final tables as it may cause issues with the sync [[source](
https://docs.airbyte.com/using-airbyte/core-concepts/typing-deduping#on-final-table-re-creation)].