File: to_arrow.Rd

package info (click to toggle)
apache-arrow 23.0.1-4
  • links: PTS
  • area: main
  • in suites:
  • size: 76,368 kB
  • sloc: cpp: 654,608; python: 70,522; ruby: 45,964; ansic: 18,742; sh: 7,367; makefile: 633; javascript: 125; xml: 41
file content (39 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/duckdb.R
\name{to_arrow}
\alias{to_arrow}
\title{Create an Arrow object from a DuckDB connection}
\usage{
to_arrow(.data)
}
\arguments{
\item{.data}{the object to be converted}
}
\value{
A \code{RecordBatchReader}.
}
\description{
This can be used in pipelines that pass data back and forth between Arrow and
DuckDB.
}
\details{
Note that you can only call \code{collect()} or \code{compute()} on the result of this
function once. To work around this limitation, you should either only call
\code{collect()} as the final step in a pipeline or call \code{as_arrow_table()} on the
result to materialize the entire Table in-memory.
}
\examples{
\dontshow{if (getFromNamespace("run_duckdb_examples", "arrow")()) withAutoprint(\{ # examplesIf}
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()
\dontshow{\}) # examplesIf}
}