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 223 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 verbs
    Most 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 tibble.
- anti_join(): the- copyargument is ignored
- distinct():- .keep_all = TRUEreturns a non-missing value if present, only returning missing values if all are missing.
- full_join(): the- copyargument is ignored
- inner_join(): the- copyargument is ignored
- left_join(): the- copyargument is ignored
- pull(): the- nameargument 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/FALSEto control this behavior, or set- options(arrow.pull_as_vector)globally.
- right_join(): the- copyargument is ignored
- semi_join(): the- copyargument is ignored
- slice_head(): slicing within groups not supported; Arrow datasets do not have row order, so head is non-deterministic;- proponly supported on queries where- nrow()is knowable without evaluating
- slice_max(): slicing within groups not supported;- with_ties = TRUE(dplyr default) is not supported;- proponly supported on queries where- nrow()is knowable without evaluating
- slice_min(): slicing within groups not supported;- with_ties = TRUE(dplyr default) is not supported;- proponly supported on queries where- nrow()is knowable without evaluating
- slice_sample(): slicing within groups not supported;- replace = TRUEand the- weight_byargument not supported;- nonly 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;- proponly supported on queries where- nrow()is knowable without evaluating
- summarise(): window functions not currently supported; arguments- .drop = FALSEand- .groups = "rowwise"not supported
Function mappings
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 281 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.
base
- as.Date(): Multiple- tryFormatsnot supported in Arrow. Consider using the lubridate specialised parsing functions- ymd(),- ymd(), etc.
- as.difftime(): only supports- units = "secs"(the default)
- data.frame():- row.namesand- check.rowsarguments not supported;- stringsAsFactorsmust be- FALSE
- difftime(): only supports- units = "secs"(the default);- tzargument not supported
- nchar():- allowNA = TRUEand- keepNA = TRUEnot supported
- paste(): the- collapseargument is not yet supported
- paste0(): the- collapseargument is not yet supported
- strptime(): accepts a- unitargument not present in the- basefunction. Valid values are "s", "ms" (default), "us", "ns".
- substr():- startand- stopmust be length 1
dplyr
- case_when():- .ptypeand- .sizearguments not supported
lubridate
- dmy():- localeargument not supported
- dmy_h():- localeargument not supported
- dmy_hm():- localeargument not supported
- dmy_hms():- localeargument not supported
- dpicoseconds(): not supported
- dym():- localeargument not supported
- fast_strptime(): non-default values of- ltand- cutoff_2000not supported
- force_tz(): Timezone conversion from non-UTC timezone not supported;- roll_dstvalues of 'error' and 'boundary' are supported for nonexistent times,- roll_dstvalues of 'error', 'pre', and 'post' are supported for ambiguous times.
- is.Date()
- is.POSIXct()
- make_datetime(): only supports UTC (default) timezone
- make_difftime(): only supports- units = "secs"(the default); providing both- numand- ...is not supported
- mdy():- localeargument not supported
- mdy_h():- localeargument not supported
- mdy_hm():- localeargument not supported
- mdy_hms():- localeargument not supported
- my():- localeargument not supported
- myd():- localeargument not supported
- parse_date_time():- quiet = FALSEis not supported Available formats are H, I, j, M, S, U, w, W, y, Y, R, T. On Linux and OS X additionally a, A, b, B, Om, p, r are available.
- ydm():- localeargument not supported
- ydm_h():- localeargument not supported
- ydm_hm():- localeargument not supported
- ydm_hms():- localeargument not supported
- ym():- localeargument not supported
- ymd():- localeargument not supported
- ymd_h():- localeargument not supported
- ymd_hm():- localeargument not supported
- ymd_hms():- localeargument not supported
- yq():- localeargument not supported
stats
- median(): approximate median (t-digest) is computed
- quantile():- probsmust be length 1; approximate quantile (t-digest) is computed
stringr
Pattern modifiers coll() and boundary() are not supported in any functions.
- str_c(): the- collapseargument is not yet supported
- str_count():- patternmust be a length 1 character vector
- str_split(): Case-insensitive string splitting and splitting into 0 parts not supported
- str_sub():- startand- endmust be length 1