Бележка
Достъпът до тази страница изисква удостоверяване. Можете да опитате да влезете или да промените директориите.
Достъпът до тази страница изисква удостоверяване. Можете да опитате да промените директориите.
Partition transform function: A transform for timestamps and dates to partition data into days. Supports Spark Connect.
Warning
Deprecated in 4.0.0. Use partitioning.days instead.
Syntax
from pyspark.sql import functions as dbf
dbf.days(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 days.
Examples
df.writeTo("catalog.db.table").partitionedBy(
days("ts")
).createOrReplace()
Note
This function can be used only in combination with the partitionedBy method of the DataFrameWriterV2.