When using semi_join() and anti_join() in dbplyr, the sql_on= argument does not parse correctly. This is needed for more complicated joins than the by= argument can handle.
suppressMessages(library(dplyr))
suppressMessages(library(dbplyr))
x= memdb_frame(x=c(1,2))
x %>% left_join(x,sql_on='"LHS".x = "RHS".x') %>% show_query# works#> <SQL>#> SELECT `LHS`.`x` AS `x.x`, `RHS`.`x` AS `x.y`#> FROM `dbplyr_001` AS `LHS`#> LEFT JOIN `dbplyr_001` AS `RHS`#> ON ("LHS".x = "RHS".x)x %>% anti_join(x,by="x") %>% show_query# works#> <SQL>#> SELECT * FROM `dbplyr_001` AS `LHS`#> WHERE NOT EXISTS (#> SELECT 1 FROM `dbplyr_001` AS `RHS`#> WHERE (`LHS`.`x` = `RHS`.`x`)#> )x %>% anti_join(x,sql_on='LHS".x = "RHS".x') %>% show_query# misses arguments#> <SQL>#> SELECT * FROM `dbplyr_001` AS `LHS`#> WHERE NOT EXISTS (#> SELECT 1 FROM `dbplyr_001` AS `RHS`#> WHERE (`LHS`. = `RHS`.)#> )
When using semi_join() and anti_join() in dbplyr, the sql_on= argument does not parse correctly. This is needed for more complicated joins than the by= argument can handle.
Created on 2020-05-06 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: