跳到内容

Apache Arrow 为进程间通信 (IPC) 的数据序列化定义了两种格式:一种是“流”格式,另一种是“文件”格式,称为 Feather。write_ipc_stream()write_feather() 分别写入这些格式。

用法

write_ipc_stream(x, sink, ...)

参数

x

data.frameRecordBatch,或 Table

sink

字符串文件路径、连接、URI 或 OutputStream,或文件系统中的路径 (SubTreeFileSystem)

...

传递给 write_feather() 的额外参数。

返回值

x,不可见地。

参见

write_feather() 用于写入 IPC 文件。write_to_raw() 用于将数据序列化到缓冲区。RecordBatchWriter 用于更底层的接口。

示例

tf <- tempfile()
on.exit(unlink(tf))
write_ipc_stream(mtcars, tf)