Notiz
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Iech unzemellen oder Verzeechnesser ze änneren.
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Verzeechnesser ze änneren.
Partition transform function: A transform for timestamps and dates to partition data into months. Supports Spark Connect.
Warning
Deprecated in 4.0.0. Use partitioning.months instead.
Syntax
from pyspark.sql import functions as dbf
dbf.months(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
Target date or timestamp column to work on. |
Returns
pyspark.sql.Column: Data partitioned by months.
Examples
df.writeTo("catalog.db.table").partitionedBy(
months("ts")
).createOrReplace()
Note
This function can be used only in combination with the partitionedBy method of the DataFrameWriterV2.