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

入力パーティション

DataSourceReaderpartitions()メソッドによって返される入力パーティションを表す基底クラス。

Databricks Runtime 14.3 LTSで追加されました

構文

Python
InputPartition(value)

パラメーター

パラメーター

Type

説明

value

すべて

このパーティションを識別する値。

注意

このクラスはピクルスにできるものでなければならない。

デフォルトの入力パーティション実装を使用する:

Python
def partitions(self):
return [InputPartition(1)]

入力パーティションクラスをサブクラス化する:

Python
from dataclasses import dataclass

@dataclass
class RangeInputPartition(InputPartition):
start: int
end: int

def partitions(self):
return [RangeInputPartition(1, 3), RangeInputPartition(4, 6)]
このページの見出し