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

パーティショニング時間

データを時間単位で分割するためのタイムスタンプの変換。

注記

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

構文

Python
from pyspark.sql.functions import partitioning

partitioning.hours(col)

パラメーター

パラメーター

Type

説明

col

pyspark.sql.Column または文字列

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

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