pyarrow.dataset.ParquetFileFormat#

class pyarrow.dataset.ParquetFileFormat(read_options=None, default_fragment_scan_options=None, **kwargs)#

Bases: FileFormat

Parquet 文件的文件格式 (FileFormat)

参数:
read_optionsParquetReadOptions

文件的读取选项。

default_fragment_scan_optionsParquetFragmentScanOptions

文件的扫描选项。

**kwargsdict

用于读取选项或扫描选项的附加选项

__init__(*args, **kwargs)#

方法

__init__(*args, **kwargs)

equals(self, ParquetFileFormat other)

inspect(self, file[, filesystem])

推断文件的模式。

make_fragment(self, file[, filesystem, ...])

从给定的文件创建 FileFragment。

make_write_options(self, **kwargs)

属性

default_extname#
default_fragment_scan_options#
equals(self, ParquetFileFormat other)#
参数:
otherpyarrow.dataset.ParquetFileFormat
返回:
bool
inspect(self, file, filesystem=None)#

推断文件的模式。

参数:
file文件对象、类路径对象或 str

要从中推断模式的文件或文件路径。

filesystemFilesystem, 可选

如果给定了 filesystem,则 file 必须是一个字符串,并指定要从文件系统读取的文件路径。

返回:
schemaSchema

从文件推断出的模式。

make_fragment(self, file, filesystem=None, Expression partition_expression=None, row_groups=None, *, file_size=None)#

从给定的文件创建 FileFragment。

参数:
file文件对象、类路径对象或 str

要从中创建片段的文件或文件路径。

filesystemFilesystem, 可选

如果给定了 filesystem,则 file 必须是一个字符串,并指定要从文件系统读取的文件路径。

partition_expressionExpression, 可选

一个表达式,保证片段中的所有行都为真。允许在扫描时使用过滤器跳过片段。

row_groupsIterable, optional

要包含的行组索引

file_sizeint, 可选

文件大小(以字节为单位)。当需要在读取前知道文件大小时,可以提高高延迟文件系统的性能。

返回:
fragmentFragment

文件片段。

make_write_options(self, **kwargs)#
参数:
**kwargsdict
返回:
pyarrow.dataset.FileWriteOptions
read_options#