Skip to content

Error when you have a full join followed by another join #1178

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

Closed
apalacio9502 opened this issue Mar 3, 2023 · 0 comments · Fixed by #1185
Closed

Error when you have a full join followed by another join #1178

apalacio9502 opened this issue Mar 3, 2023 · 0 comments · Fixed by #1185

Comments

@apalacio9502
Copy link

apalacio9502 commented Mar 3, 2023

Hello,

Using dbplyr version 2.3.1 I see the following bug, which I have validated in both Oracle and SQLite. The error is related to a full join followed by another join (left_join, inner_join, etc).

con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
copy_to(con, mtcars)
mtcars_test <- tbl(con, "mtcars")
result <- mtcars_test %>% 
  full_join(mtcars_test) %>% 
  left_join(mtcars_test) %>% show_query()

Error in `new_joins_data()`:
! `x_lq$vars$var[idx][[1]]` must have size 1, not size 2.

If an intermediate step such as a mutate is performed between the full join and the next join, the error does not occur.

Regards,


R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=Spanish_Colombia.utf8  LC_CTYPE=Spanish_Colombia.utf8   
[3] LC_MONETARY=Spanish_Colombia.utf8 LC_NUMERIC=C                     
[5] LC_TIME=Spanish_Colombia.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] dplyr_1.1.0.9000

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.10       dbplyr_2.3.1      compiler_4.2.2    pillar_1.8.1      later_1.3.0      
 [6] tools_4.2.2       odbc_1.3.4        digest_0.6.31     bit_4.0.5         memoise_2.0.1    
[11] RSQLite_2.3.0     tibble_3.1.8      jsonlite_1.8.4    lifecycle_1.0.3   lattice_0.20-45  
[16] pkgconfig_2.0.3   rlang_1.0.6.9000  shiny_1.7.4       DBI_1.1.3         cli_3.6.0        
[21] rstudioapi_0.14   yaml_2.3.7        fastmap_1.1.1     generics_0.1.3    vctrs_0.5.2.9000 
[26] htmlwidgets_1.6.1 hms_1.1.2         tidyselect_1.2.0  bit64_4.0.5       grid_4.2.2       
[31] glue_1.6.2        R6_2.5.1          fansi_1.0.4       pool_1.0.1        purrr_1.0.1      
[36] blob_1.2.3        magrittr_2.0.3    promises_1.2.0.1  ellipsis_0.3.2    htmltools_0.5.4  
[41] mime_0.12         xtable_1.8-4      httpuv_1.6.9      config_0.3.1      utf8_1.2.3       
[46] shinybusy_0.3.1   cachem_1.0.7      zoo_1.8-11    ```
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