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) # usingarrowtablesworks ------------------------------------------------------
cars_arrow_table %>% left_join(other_mtcars_data) %>% count(main_color) %>% collect()
# usingopendatasetcrashesR ------------------------------------------------------------------
other_mtcars_data %>% left_join(cars_arrow) %>% count(main_color) %>% collect()
#othervariationalsocrashcars_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()
#computealsocrashescars_arrow %>% left_join(other_mtcars_data) %>% count(main_color) %>% compute()
# workaroundwithduckdb ------------------------------------------------------
##thisworkscars_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()
##thisdoesn't (don'tknowifexpectedtoworkactually)
cars_arrow %>% left_join(other_mtcars_data) %>% to_duckdb() Environment: R version 4.0.4
Reporter: Will Jones / @wjones127
Assignee: Will Jones / @wjones127
Related issues:
PRs and other links:
Note: This issue was originally created as ARROW-14908. Please see the migration documentation for further details.
Environment: R version 4.0.4
Reporter: Will Jones / @wjones127
Assignee: Will Jones / @wjones127
Related issues:
PRs and other links:
Note: This issue was originally created as ARROW-14908. Please see the migration documentation for further details.