dplyr's row-set operations on GPU tables, run on the GPU:
union(): the distinct rows ofx, inx's order, then the rows ofynot already inx, iny's order.union_all(): the rows ofx(duplicates kept), then those ofy.intersect()andsetdiff(): distinct rows ofx, inx's order, that are (or are not) iny.symdiff(): the rows ofsetdiff(x, y), then those ofsetdiff(y, x).setequal():TRUEorFALSE, ignoring row order and duplicates on both sides.
As in dplyr, x and y must have the same column names (the order may
differ: y is reordered to x's), and each column must have a common
type: logical, integer and double columns combine to the wider type, a
logical or integer column with an integer64 one gives integer64 (integer64
and double have no common type: an error, as in dplyr), a Date and a
POSIXct combine to POSIXct, two factors
with different levels combine to a factor with the union of the levels,
and a factor next to a character column gives a character column. A
column-type mix that dplyr refuses (integer vs. character, factor vs.
integer, ...) is an error naming the column and both types.
Usage
# S3 method for class 'tbl_gpu'
union(x, y, ...)
# S3 method for class 'tbl_gpu'
union_all(x, y, ...)
# S3 method for class 'tbl_gpu'
intersect(x, y, ...)
# S3 method for class 'tbl_gpu'
setdiff(x, y, ...)
# S3 method for class 'tbl_gpu'
symdiff(x, y, ...)
# S3 method for class 'tbl_gpu'
setequal(x, y, ...)Arguments
- x, y
tbl_gpuobjects.ymay also be a plaindata.frame(uploaded automatically viatbl_gpu()) – unlike the join verbs, these generics have nocopy=argument.- ...
Not used; must be empty (dplyr itself requires this too).
Value
A tbl_gpu with x's column order and grouping, with the rows in
the order described above, except setequal(), which returns TRUE or
FALSE.
Details
These run in dplyr on the CPU: tables with duplicated column names; a
Date column next to a POSIXct column in a zone other than UTC (the
Date becomes local midnight of that zone); a column with element names
or a one-column matrix column, which dplyr combines by its own rules
(except in setequal()); and a rowwise x.
