Skip to content

Add union all #1045

@tomasgreif

Description

@tomasgreif

union all keeps rows even they are equal. Adding it would be pretty easy:

sets.r

#' @export
union <- function(x, y, ...) UseMethod("union_all")

tbl-sql.r

#' @export
union_all.tbl_sql <- function(x, y, copy = FALSE, ...) {
  y <- auto_copy(x, y, copy)
  sql <- sql_set_op(x$src$con, x, y, "UNION ALL")
  update(tbl(x$src, sql), group_by = groups(x))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions