pyarrow.orc.ORCWriter#

class pyarrow.orc.ORCWriter(where, *, file_version='0.12', batch_size=1024, stripe_size=67108864, compression='uncompressed', compression_block_size=65536, compression_strategy='speed', row_index_stride=10000, padding_tolerance=0.0, dictionary_key_size_threshold=0.0, bloom_filter_columns=None, bloom_filter_fpp=0.05)[source]#

基类: object

单个 ORC 文件的写入器接口

参数:
wherestrpyarrow.io.NativeFile

可写目标。有关传递 Python 文件对象或字节缓冲区的信息,请参阅 pyarrow.io.PythonFileInterface、pyarrow.io.BufferOutputStream 或 pyarrow.io.FixedSizeBufferWriter。

file_version{“0.11”, “0.12”},默认值 “0.12”

确定要使用的 ORC 文件版本。Hive 0.11 / ORC v0 是旧版本,而 Hive 0.12 / ORC v1 是新版本。

batch_sizeint,默认值 1024

ORC 写入器每次写入的行数。

stripe_sizeint,默认值 64 * 1024 * 1024

每个 ORC 条带的字节大小。

compressionstr,默认值 ‘uncompressed’

压缩编解码器。有效值:{‘UNCOMPRESSED’、‘SNAPPY’、‘ZLIB’、‘LZ4’、‘ZSTD’} 请注意,目前不支持 LZ0。

compression_block_sizeint,默认值 64 * 1024

每个压缩块的字节大小。

compression_strategystr,默认值 ‘speed’

压缩策略,即速度与大小缩减。有效值:{‘SPEED’(速度),‘COMPRESSION’(压缩)}

row_index_strideint,默认值 10000

行索引步长,即行索引中每个条目对应的行数。

padding_tolerancedouble,默认值 0.0

填充容差。

dictionary_key_size_thresholddouble,默认值 0.0

字典键大小阈值。0 表示禁用字典编码。1 表示始终启用字典编码。

bloom_filter_columnsNone,类集合或类列表,默认值 None

使用布隆过滤器的列。

bloom_filter_fppdouble,默认值 0.05

布隆过滤器假阳性率的上限。

__init__(where, *, file_version='0.12', batch_size=1024, stripe_size=67108864, compression='uncompressed', compression_block_size=65536, compression_strategy='speed', row_index_stride=10000, padding_tolerance=0.0, dictionary_key_size_threshold=0.0, bloom_filter_columns=None, bloom_filter_fpp=0.05)[source]#

方法

__init__(where, *[, file_version, ...])

close()

关闭 ORC 文件

write(table)

将表写入 ORC 文件。

属性

close()[source]#

关闭 ORC 文件

is_open = False#
write(table)[source]#

将表写入 ORC 文件。表的模式必须与打开 ORC 文件时使用的模式相同。

参数:
tablepyarrow.Table

要写入 ORC 文件的表