Skip to content

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

@apalacio9502

Description

@apalacio9502

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    ```

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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions