> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prophecy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Wipe and Replace Table

> Replace all the rows in the target table

On each run, Prophecy removes all existing rows from the target table and writes the incoming dataset. The target table always reflects the latest state of the source data.

## Example: Replace product list

A product catalog is refreshed each day by replacing the existing table with the latest product list.

<div class="table-example">
  **Existing target table**

  | PRODUCT\_ID | NAME     | QUANTITY |
  | ----------- | -------- | -------- |
  | 101         | Laptop   | 25       |
  | 102         | Mouse    | 84       |
  | 103         | Keyboard | 40       |

  **Incoming data set**

  | PRODUCT\_ID | NAME    | QUANTITY |
  | ----------- | ------- | -------- |
  | 101         | Laptop  | 21       |
  | 104         | Monitor | 17       |

  **Resulting target table**

  | PRODUCT\_ID | NAME    | QUANTITY |
  | ----------- | ------- | -------- |
  | 101         | Laptop  | 21       |
  | 104         | Monitor | 17       |

  Because this write mode replaces the entire table, any rows that are not present in the incoming dataset are removed. Prophecy does not compare existing and incoming rows or merge individual records. In this example, products `102` and `103` are removed because they are not included in the latest product list.
</div>

## Partition the target table (BigQuery only)

The following partitioning parameters are available for the **Wipe and Replace Table** write mode on BigQuery.

| Parameter                | Description                                                                                                                                                                                                                                                                                     |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Column Name              | The name of the column used for partitioning the target table.                                                                                                                                                                                                                                  |
| Data Type                | The data type of the partition column. <br />Supported types: `timestamp`, `date`, `datetime`, and `int64`.                                                                                                                                                                                     |
| Partition By granularity | Applicable only to `timestamp`, `date`, or `datetime` data type. <br />Defines the time-based partition granularity: `hour`, `day`, `month`, or `year`.                                                                                                                                         |
| Partition Range          | Applicable only to `int64` data type. <br />Specify a numeric range for partitioning using a **start**, **end**, and **interval** value (e.g., start=`0`, end=`1000`, interval=`10`).<br />You must define an interval value so that Prophecy knows at what intervals to create the partitions. |

<Info>
  Only BigQuery tables can be partitioned at the table level. To learn more about partitioning, jump
  to [Partitioning](#partitioning).
</Info>
