---
title: createOrReplace
description: "DataFrameWriterV2.createOrReplace method in PySpark: Creates a new table or replaces an existing table with the contents of the DataFrame."
canonical_url: https://docs.databricks.com/aws/en/pyspark/reference/classes/dataframewriterv2/createOrReplace
---

# createOrReplace

Creates a new table or replaces an existing table with the contents of the `DataFrame`. The output table's schema, partition layout, properties, and other configuration are based on the contents of the `DataFrame` and the configuration set on this writer. If the table exists, its configuration and data are replaced.

## Syntax

```
createOrReplace()
```

## Returns

None
