跳至内容

将对象转换为 Arrow RecordBatchReader

用法

as_record_batch_reader(x, ...)

# S3 method for class 'RecordBatchReader'
as_record_batch_reader(x, ...)

# S3 method for class 'Table'
as_record_batch_reader(x, ...)

# S3 method for class 'RecordBatch'
as_record_batch_reader(x, ...)

# S3 method for class 'data.frame'
as_record_batch_reader(x, ...)

# S3 method for class 'Dataset'
as_record_batch_reader(x, ...)

# S3 method for class '`function`'
as_record_batch_reader(x, ..., schema)

# S3 method for class 'arrow_dplyr_query'
as_record_batch_reader(x, ...)

# S3 method for class 'Scanner'
as_record_batch_reader(x, ...)

参数

x

要转换为 RecordBatchReader 的对象

...

传递给 S3 方法

schema

x 是一个函数时,必须与每次调用 x 返回的模式匹配的 schema()

返回值

一个 RecordBatchReader

示例

reader <- as_record_batch_reader(data.frame(col1 = 1, col2 = "two"))
reader$read_next_batch()
#> RecordBatch
#> 1 rows x 2 columns
#> $col1 <double>
#> $col2 <string>
#> 
#> See $metadata for additional Schema metadata