メインコンテンツまでスキップ

パーティション分割.バケット

入力列のハッシュによってパーティション分割する任意の型の変換。

注記

この関数は、 DataFrameWriterV2.partitionedByメソッドと組み合わせてのみ使用できます。

構文

Python
from pyspark.sql.functions import partitioning

partitioning.bucket(numBuckets, col)

パラメーター

パラメーター

Type

説明

numBuckets

pyspark.sql.Column または整数

バケットの数。

col

pyspark.sql.Column または文字列

作業対象となる日付またはタイムスタンプの列。

Python
from pyspark.sql.functions import partitioning
df.writeTo("catalog.db.table").partitionedBy(
partitioning.bucket(42, "ts")
).createOrReplace()