Movatterモバイル変換


[0]ホーム

URL:


Skip to contents

Create an Arrow object from a DuckDB connection

Source:R/duckdb.R
to_arrow.Rd

This can be used in pipelines that pass data back and forth between Arrow andDuckDB.

Usage

to_arrow(.data)

Arguments

.data

the object to be converted

Value

ARecordBatchReader.

Details

Note that you can only callcollect() orcompute() on the result of thisfunction once. To work around this limitation, you should either only callcollect() as the final step in a pipeline or callas_arrow_table() on theresult to materialize the entire Table in-memory.

Examples

library(dplyr)ds<-InMemoryDataset$create(mtcars)ds%>%filter(mpg<30)%>%to_duckdb()%>%group_by(cyl)%>%summarize(mean_mpg=mean(mpg, na.rm=TRUE))%>%to_arrow()%>%collect()#># A tibble: 3 x 2#>     cyl mean_mpg#><dbl><dbl>#>1     4     23.7#>2     6     19.7#>3     8     15.1

[8]ページ先頭

©2009-2025 Movatter.jp