[ 
https://issues.apache.org/jira/browse/ARROW-14908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17450632#comment-17450632
 ] 

Fabio Machado commented on ARROW-14908:
---------------------------------------

Here's the sessionInfo()
{code:java}
R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252  
 
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                         
 
[5] LC_TIME=English_United States.1252    
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     
other attached packages:
 [1] arrow_6.0.1     forcats_0.5.1   stringr_1.4.0   dplyr_1.0.7    
 [5] purrr_0.3.4     readr_1.4.0     tidyr_1.1.3     tibble_3.1.3   
 [9] ggplot2_3.3.3   tidyverse_1.3.0
loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7        lubridate_1.7.9.2 assertthat_0.2.1  digest_0.6.27    
 [5] utf8_1.1.4        R6_2.5.0          cellranger_1.1.0  odbc_1.3.0       
 [9] backports_1.2.1   reprex_1.0.0      httr_1.4.2        pillar_1.6.2     
[13] tictoc_1.0        rlang_0.4.11      curl_4.3          readxl_1.3.1     
[17] rstudioapi_0.13   data.table_1.14.0 blob_1.2.1        DT_0.17          
[21] foreign_0.8-81    htmlwidgets_1.5.3 bit_4.0.4         munsell_0.5.0    
[25] tinytex_0.29      broom_0.7.5       compiler_4.0.4    modelr_0.1.8     
[29] xfun_0.21         pkgconfig_2.0.3   htmltools_0.5.1.1 tidyselect_1.1.1 
[33] rio_0.5.26        fansi_0.4.2       crayon_1.4.1      dbplyr_2.1.1     
[37] withr_2.4.1       grid_4.0.4        jsonlite_1.7.2    gtable_0.3.0     
[41] lifecycle_1.0.0   DBI_1.1.1         magrittr_2.0.1    scales_1.1.1     
[45] zip_2.1.1         cli_2.3.1         stringi_1.5.3     fs_1.5.0         
[49] xml2_1.3.2        ellipsis_0.3.2    generics_0.1.0    vctrs_0.3.8      
[53] openxlsx_4.2.3    tools_4.0.4       bit64_4.0.5       glue_1.4.2       
[57] hms_1.0.0         colorspace_2.0-0  sessioninfo_1.1.1 rvest_1.0.0      
[61] haven_2.3.1      


{code}
 

> [R] join followed by a summarize and collect crashes R
> ------------------------------------------------------
>
>                 Key: ARROW-14908
>                 URL: https://issues.apache.org/jira/browse/ARROW-14908
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: R
>    Affects Versions: 6.0.0
>         Environment: R version 4.0.4
>            Reporter: Fabio Machado
>            Priority: Critical
>
> {code:java}
> library(tidyverse)
> library(arrow)
> car_info <- rownames_to_column(mtcars, "car_info") 
> cars_arrow_table <- arrow_table(car_info)
> other_mtcars_data <- select(car_info, 1) %>% 
>   mutate(main_color = sample( c("red", "blue", "white", "black"), size = n(), 
> replace = TRUE)) %>% 
>   arrow::arrow_table()
> temp <- tempdir()
> par_temp <- paste0(temp, "\\parquet")
> car_info %>% arrow::write_dataset(par_temp)
> cars_arrow <- arrow::open_dataset(par_temp) 
> # using arrow tables works 
> ------------------------------------------------------
> cars_arrow_table %>% left_join(other_mtcars_data) %>% count(main_color) %>% 
> collect()
> # using open dataset crashes R 
> ------------------------------------------------------------------
> other_mtcars_data %>% 
>   left_join(cars_arrow) %>% 
>   count(main_color) %>% 
>   collect()
> #other variation also crash
> cars_arrow %>% 
>   left_join(other_mtcars_data) %>% 
>   count(main_color) %>% 
>   collect()
> cars_arrow %>% 
>   left_join(other_mtcars_data) %>% 
>   group_by(main_color) %>% 
>   summarise(n = n()) %>% 
>   collect()
> #compute also crashes
> cars_arrow %>% 
>   left_join(other_mtcars_data) %>% 
>   count(main_color) %>% 
>   compute()
> # workaround with duckdb 
> ------------------------------------------------------
> ##this works
> cars_duck <- to_duckdb(cars_arrow, auto_disconnect = TRUE)
> other_cars_duck <- to_duckdb(other_mtcars_data, auto_disconnect = TRUE)
>     
> cars_duck %>% 
>   left_join(other_cars_duck) %>%
>   count(main_color) %>%
>   collect()
> ##this doesn't (don't know if expected to work actually)
> cars_arrow %>% 
>   left_join(other_mtcars_data) %>% 
>   to_duckdb() {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to