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

na_matches = "na" doesn't work for DuckDB #704

Closed
mgirlich opened this issue Sep 17, 2021 · 0 comments · Fixed by #705
Closed

na_matches = "na" doesn't work for DuckDB #704

mgirlich opened this issue Sep 17, 2021 · 0 comments · Fixed by #705

Comments

@mgirlich
Copy link
Collaborator

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

con <- DBI::dbConnect(duckdb::duckdb())
x <- copy_to(
  src_dbi(con),
  tibble(x = 1),
  name = "dummy"
)
left_join(x, x, by = "x", na_matches = "na") %>% 
  show_query()
#> <SQL>
#> SELECT "LHS"."x" AS "x"
#> FROM "dummy" AS "LHS"
#> LEFT JOIN "dummy" AS "RHS"
#> ON (CASE WHEN ("LHS"."x" = "RHS"."x") OR ("LHS"."x" IS NULL AND "RHS"."x" IS NULL) THEN 0 ELSE 1 = 0)
left_join(x, x, by = "x", na_matches = "na")
#> Error in .local(conn, statement, ...): duckdb_prepare_R: Failed to prepare query SELECT *
#> FROM (SELECT "LHS"."x" AS "x"
#> FROM "dummy" AS "LHS"
#> LEFT JOIN "dummy" AS "RHS"
#> ON (CASE WHEN ("LHS"."x" = "RHS"."x") OR ("LHS"."x" IS NULL AND "RHS"."x" IS NULL) THEN 0 ELSE 1 = 0)
#> ) "q01"
#> LIMIT 11
#> Error: Parser Error: syntax error at or near ")"
#> LINE 5: ...LEFT JOIN "dummy" AS "RHS"
#> ON (CASE WHEN ("LHS"."x" = "RHS"."x") OR ("LHS"."x" IS NULL AND "RHS"."x" IS NULL) THEN 0 ELSE 1 = 0)
#>                                                   ^

Created on 2021-09-17 by the reprex package (v2.0.1)

@mgirlich mgirlich changed the title na_matches = "na" doesn't work for SQLite na_matches = "na" doesn't work for DuckDB Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant