pyspark.sql.functions.
bucket
Partition transform function: A transform for any type that partitions by a hash of the input column.
New in version 3.1.0.
Notes
This function can be used only in combination with partitionedBy() method of the DataFrameWriterV2.
partitionedBy()
Examples
>>> df.writeTo("catalog.db.table").partitionedBy( ... bucket(42, "ts") ... ).createOrReplace()