Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support join in dbplyr query #3

Open
eitsupi opened this issue Nov 16, 2023 · 2 comments
Open

Support join in dbplyr query #3

eitsupi opened this issue Nov 16, 2023 · 2 comments
Labels
dplyr related to dplyr/dbplyr methods enhancement New feature or request

Comments

@eitsupi
Copy link
Member

eitsupi commented Nov 16, 2023

Seems we should impliment auto_copy.tbl_polarssql_connection.
https://github.com/tidyverse/dbplyr/blob/388a6eef0e634efa693d809061ceac91d3b69a77/R/verb-copy-to.R#L97-L101

Something like:

auto_copy.tbl_polarssql_connection <- function(x, y, copy = FALSE, ...) {
  copy_to(x$src, as_polars_lf(y), unique_table_name(), ...)
}

Since the type of y is unknown, we need a generic function as_polars_lf here and need to convert it to polars LazyFrame.

@eitsupi eitsupi added enhancement New feature or request dplyr related to dplyr/dbplyr methods labels Nov 16, 2023
@eitsupi
Copy link
Member Author

eitsupi commented Nov 17, 2023

dbplyr generates SQL like this by default:

SELECT "band_members".*, "plays"
FROM "band_members"
LEFT JOIN "band_instruments"
  ON ("band_members"."name" = "band_instruments"."name")

But Polars doesn't seem to support () after ON.

@eitsupi
Copy link
Member Author

eitsupi commented Dec 4, 2023

But Polars doesn't seem to support () after ON.

Maybe came from here.
https://github.com/pola-rs/polars/blob/447e750d338b904a190f824049af3087d837afbc/crates/polars-sql/src/sql_expr.rs#L690-L728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dplyr related to dplyr/dbplyr methods enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant