Skip to content

* in joins #898

@hadley

Description

@hadley

Would be nice if:

library(dbplyr)
library(dplyr, warn.conflicts = FALSE)

lf1 <- lazy_frame(!!!setNames(as.list(1:26), letters))
lf2 <- lazy_frame(a = 1, a1 = 1, a2 = 1)

lf1 |> left_join(lf2)
#> Joining, by = "a"
#> <SQL>
#> SELECT
#>   `LHS`.`a` AS `a`,
#>   `b`,
#>   `c`,
#>   `d`,
#>   `e`,
#>   `f`,
#>   `g`,
#>   `h`,
#>   `i`,
#>   `j`,
#>   `k`,
#>   `l`,
#>   `m`,
#>   `n`,
#>   `o`,
#>   `p`,
#>   `q`,
#>   `r`,
#>   `s`,
#>   `t`,
#>   `u`,
#>   `v`,
#>   `w`,
#>   `x`,
#>   `y`,
#>   `z`,
#>   `a1`,
#>   `a2`
#> FROM `df` AS `LHS`
#> LEFT JOIN `df` AS `RHS`
#>   ON (`LHS`.`a` = `RHS`.`a`)

Created on 2022-05-25 by the reprex package (v2.0.1)

Instead produced:

SELECT
  `LHS`.*, `a1`, `a2`
FROM `df` AS `LHS`
LEFT JOIN `df` AS `RHS`
  ON (`LHS`.`a` = `RHS`.`a`)

No idea how feasible this is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions