---
title: overwritePartitions
description: "DataFrameWriterV2.overwritePartitions method in PySpark: Overwrites all partitions for which the DataFrame contains at least one row with the contents of the DataFrame in the output table."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/dataframewriterv2/overwritePartitions
---

# overwritePartitions

Overwrites all partitions for which the `DataFrame` contains at least one row with the contents of the `DataFrame` in the output table. This operation is equivalent to Hive's `INSERT OVERWRITE ... PARTITION`, which replaces partitions dynamically depending on the contents of the `DataFrame`.

## Syntax

```
overwritePartitions()
```

## Returns

None
