The arrow package contains methods for 37 dplyr table functions, many of
which are "verbs" that do transformations to one or more tables.
The package also has mappings of 207 R functions to the corresponding
functions in the Arrow compute library. These allow you to write code inside
of dplyr methods that call R functions, including many in packages like
stringr and lubridate, and they will get translated to Arrow and run
on the Arrow query engine (Acero). This document lists all of the mapped
functions.
dplyr verbsMost verb functions return an arrow_dplyr_query object, similar in spirit
to a dbplyr::tbl_lazy. This means that the verbs do not eagerly evaluate
the query on the data. To run the query, call either compute(),
which returns an arrow Table, or collect(), which pulls the resulting
Table into an R data.frame.
anti_join(): the copy and na_matches arguments are ignored
distinct(): .keep_all = TRUE not supported
full_join(): the copy and na_matches arguments are ignored
inner_join(): the copy and na_matches arguments are ignored
left_join(): the copy and na_matches arguments are ignored
mutate(): window functions (e.g. things that require aggregation within groups) not currently supported
pull(): the name argument is not supported; returns an R vector by default but this behavior is deprecated and will return an Arrow ChunkedArray in a future release. Provide as_vector = TRUE/FALSE to control this behavior, or set options(arrow.pull_as_vector) globally.
right_join(): the copy and na_matches arguments are ignored
semi_join(): the copy and na_matches arguments are ignored
slice_head(): slicing within groups not supported; Arrow datasets do not have row order, so head is non-deterministic; prop only supported on queries where nrow() is knowable without evaluating
slice_max(): slicing within groups not supported; with_ties = TRUE (dplyr default) is not supported; prop only supported on queries where nrow() is knowable without evaluating
slice_min(): slicing within groups not supported; with_ties = TRUE (dplyr default) is not supported; prop only supported on queries where nrow() is knowable without evaluating
slice_sample(): slicing within groups not supported; replace = TRUE and the weight_by argument not supported; n only supported on queries where nrow() is knowable without evaluating
slice_tail(): slicing within groups not supported; Arrow datasets do not have row order, so tail is non-deterministic; prop only supported on queries where nrow() is knowable without evaluating
summarise(): window functions not currently supported; arguments .drop = FALSE and `.groups = "rowwise" not supported
In the list below, any differences in behavior or support between Acero and the R function are listed. If no notes follow the function name, then you can assume that the function works in Acero just as it does in R.
Functions can be called either as pkg::fun() or just fun(), i.e. both
str_sub() and stringr::str_sub() work.
In addition to these functions, you can call any of Arrow's 243 compute
functions directly. Arrow has many functions that don't map to an existing R
function. In other cases where there is an R function mapping, you can still
call the Arrow function directly if you don't want the adaptations that the R
mapping has that make Acero behave like R. These functions are listed in the
C++ documentation, and
in the function registry in R, they are named with an arrow_ prefix, such
as arrow_ascii_is_decimal.
as.Date(): Multiple tryFormats not supported in Arrow.
Consider using the lubridate specialised parsing functions ymd(), ymd(), etc.
as.difftime(): only supports units = "secs" (the default)
data.frame(): row.names and check.rows arguments not supported;
stringsAsFactors must be FALSE
difftime(): only supports units = "secs" (the default);
tz argument not supported
nchar(): allowNA = TRUE and keepNA = TRUE not supported
paste(): the collapse argument is not yet supported
paste0(): the collapse argument is not yet supported
strptime(): accepts a unit argument not present in the base function.
Valid values are "s", "ms" (default), "us", "ns".
substr(): start and stop must be length 1
dmy(): locale argument not supported
dmy_h(): locale argument not supported
dmy_hm(): locale argument not supported
dmy_hms(): locale argument not supported
dpicoseconds(): not supported
dym(): locale argument not supported
fast_strptime(): non-default values of lt and cutoff_2000 not supported
is.Date()
is.POSIXct()
make_datetime(): only supports UTC (default) timezone
make_difftime(): only supports units = "secs" (the default);
providing both num and ... is not supported
mdy(): locale argument not supported
mdy_h(): locale argument not supported
mdy_hm(): locale argument not supported
mdy_hms(): locale argument not supported
my(): locale argument not supported
myd(): locale argument not supported
parse_date_time(): quiet = FALSE is not supported
ydm(): locale argument not supported
ydm_h(): locale argument not supported
ydm_hm(): locale argument not supported
ydm_hms(): locale argument not supported
ym(): locale argument not supported
ymd(): locale argument not supported
ymd_h(): locale argument not supported
ymd_hm(): locale argument not supported
ymd_hms(): locale argument not supported
yq(): locale argument not supported
median(): approximate median (t-digest) is computed
quantile(): probs must be length 1;
approximate quantile (t-digest) is computed
Pattern modifiers coll() and boundary() are not supported in any functions.
str_c(): the collapse argument is not yet supported
str_count(): pattern must be a length 1 character vector
str_like(): not yet in a released version of stringr, but it is supported in arrow
str_split(): Case-insensitive string splitting and splitting into 0 parts not supported
str_sub(): start and end must be length 1