pyarrow.dataset.CsvFileFormat#

class pyarrow.dataset.CsvFileFormat(ParseOptions parse_options=None, default_fragment_scan_options=None, ConvertOptions convert_options=None, ReadOptions read_options=None)#

Bases: FileFormat

CSV 文件的 FileFormat。

参数:
parse_optionspyarrow.csv.ParseOptions

有关 CSV 解析的选项。

default_fragment_scan_optionsCsvFragmentScanOptions

碎片扫描的默认选项。

convert_optionspyarrow.csv.ConvertOptions

有关值转换的选项。

read_optionspyarrow.csv.ReadOptions

常规读取选项。

__init__(*args, **kwargs)#

方法

__init__(*args, **kwargs)

equals(self, CsvFileFormat other)

inspect(self, file[, filesystem])

推断文件的模式。

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

从给定的文件创建 FileFragment。

make_write_options(self, **kwargs)

属性

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

推断文件的模式。

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

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

filesystemFilesystem, 可选

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

返回:
schemaSchema

从文件推断出的模式。

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

从给定的文件创建 FileFragment。

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

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

filesystemFilesystem, 可选

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

partition_expressionExpression, 可选

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

file_sizeint, 可选

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

返回:
fragmentFragment

文件片段。

make_write_options(self, **kwargs)#
参数:
**kwargsdict
返回:
pyarrow.csv.WriteOptions
parse_options#