---
title: replace (DataFrameWriterV2)
description: "DataFrameWriterV2.replace method in PySpark: Replaces an existing table with the contents of the DataFrame."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/dataframewriterv2/replace
---

# replace (DataFrameWriterV2)

Replaces an existing table with the contents of the `DataFrame`. The existing table's schema, partition layout, properties, and other configuration are replaced with the contents of the `DataFrame` and the configuration set on this writer.

## Syntax

```
replace()
```

## Returns

None
