pyarrow.dataset.Partitioning#

class pyarrow.dataset.Partitioning#

基类: _Weakrefable

__init__(*args, **kwargs)#

方法

__init__(*args, **kwargs)

format(self, expr)

Convert a filter expression into a tuple of (directory, filename) using the current partitioning scheme

parse(self, path)

将路径解析为分区表达式。

属性

模式

The arrow Schema attached to the partitioning.

format(self, expr)#

Convert a filter expression into a tuple of (directory, filename) using the current partitioning scheme

参数:
exprpyarrow.dataset.Expression
返回:
tuple[str, str]

示例

Specify the Schema for paths like “/2009/June”

>>> import pyarrow as pa
>>> import pyarrow.dataset as ds
>>> import pyarrow.compute as pc
>>> part = ds.partitioning(pa.schema([("year", pa.int16()),
...                                   ("month", pa.string())]))
>>> part.format(
...     (pc.field("year") == 1862) & (pc.field("month") == "Jan")
... )
('1862/Jan', '')
parse(self, path)#

将路径解析为分区表达式。

参数:
pathstr
返回:
pyarrow.dataset.Expression
schema#

The arrow Schema attached to the partitioning.