You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jeanette Clark:
I am seeing similar issues (but without the summarize). The crash only occurs after the join, filtering, and even collecting the entire (large) table works fine. Example I was working off of and session info are below.
The crash happens only when at least one of the datasets being joined is a file-backed dataset. It doesn't matter which side of the join. But join on in-memory Tables does not crash.
Partitioning is irrelevant. Her reprex doesn't have partitioning but we also tried with a partition and even joining on the partition column, all failed.
Will Jones / @wjones127: [~jclark] thanks for that example repro. I get a crash just like you said in Arrow 6.0.0 (but don't on my Mac). I also tried in the dev version of Arrow, and instead get the following error:
Will Jones / @wjones127:
I've made some progress, but not yet found a fix. This issue isn't strictly linked to the Windows platform; instead it has do to with the setting options(arrow.use_threads = FALSE), which it doesn't seem the join implementation anticipated. That setting is FALSE on Windows by default, but TRUE on other platforms. I can reproduce this issue on Mac OS by setting it to FALSE.
Note that I can get the example to work on Windows by setting options(arrow.use_threads = TRUE), so that may be a viable workaround in some cases. However, other issues have been reported on Windows with the use_threads option, which is why it has been turned off for now on Windows.
Sam Albers / @boshek:
Some additional break crumbs. The examples (run on windows 10, with arrow 7.0.0) are wrapped in reprex::reprex because it catches the R crash nicely.
To provide an update: We have identified the issue now and my fix is currently being reviewed. It will likely be included in a 7.0.1 release.
You may be able to workaround the issue by setting options(arrow.use_threads = TRUE), which will avoid this bug. (However, there are some cases where turning on threads on Windows cause other issues right now, hence why it's off by default on Windows.)
Sam Albers / @boshek: @wjones127 that's great! Does that catch instances where the join columns are partitions? I don't see any tests for that and the reprexes above suggest that might be relevant.
Weston Pace / @westonpace:
I went ahead and marked this closed with Will's change but feel free to reopen if either of you decide this doesn't cover all cases.
Will Jones / @wjones127:
Ah it actually does not. I don't think the problem is the partition columns per se; I think the fix i provided works for joining a dataset to an in-memory table, but not a dataset to a dataset. So need to add an additional test for that. Thanks for pointing that out! (y)
@westonpace With a dataset to dataset join we are getting a thread index of 2 now. I guess we have an IO thread per scanner, right? Probably need to modify our approach.
Sam Albers / @boshek: @wjones127 just to close the loop, your fix appears to have sorted out all the cases i outlined. Nice work! For the test, I was thinking something like this:
test_that("arrow dplyr query can join on a partitioned Dataset", {
dir_out <- tempdir()
iris_grouped <- group_by(iris, Species)
write_dataset(iris_grouped, file.path(dir_out, "iris"))
species_codes <- data.frame(
Species = c("setosa", "versicolor", "virginica"),
code = c("SET", "VER", "VIR")
)
iris <- open_dataset(file.path(dir_out, "iris"))
res <- left_join(iris, species_codes) %>% collect() # Weshouldnotsegfaulthere.
expect_equal(nrow(res), 150)
})
Activity
asfimport commentedon Nov 29, 2021
Neal Richardson / @nealrichardson:
Can you install the latest patch release (6.0.1)? These all work for me on that version.
asfimport commentedon Nov 29, 2021
Fabio Machado:
I installed the CRAN 6.0.1 version but I'm still getting crashes.
asfimport commentedon Nov 29, 2021
Neal Richardson / @nealrichardson:
Ok, can you provide sessionInfo() and any other system details?
asfimport commentedon Nov 29, 2021
Fabio Machado:
Here's the sessionInfo()
asfimport commentedon Jan 13, 2022
Jeanette Clark:
I am seeing similar issues (but without the summarize). The crash only occurs after the join, filtering, and even collecting the entire (large) table works fine. Example I was working off of and session info are below.
asfimport commentedon Jan 14, 2022
Neal Richardson / @nealrichardson:
Other angles
[~jclark]and I explored:asfimport commentedon Jan 14, 2022
Will Jones / @wjones127:
[~jclark]thanks for that example repro. I get a crash just like you said in Arrow 6.0.0 (but don't on my Mac). I also tried in the dev version of Arrow, and instead get the following error:Looking at the traceback from the Arrow 6 crash it's not immediately obvious that it's the same error as above, but I will continue to look deeper.
asfimport commentedon Feb 9, 2022
Will Jones / @wjones127:
I've made some progress, but not yet found a fix. This issue isn't strictly linked to the Windows platform; instead it has do to with the setting
options(arrow.use_threads = FALSE), which it doesn't seem the join implementation anticipated. That setting is FALSE on Windows by default, but TRUE on other platforms. I can reproduce this issue on Mac OS by setting it to FALSE.Note that I can get the example to work on Windows by setting
options(arrow.use_threads = TRUE), so that may be a viable workaround in some cases. However, other issues have been reported on Windows with the use_threads option, which is why it has been turned off for now on Windows.asfimport commentedon Feb 14, 2022
Sam Albers / @boshek:
Some additional break crumbs. The examples (run on windows 10, with arrow 7.0.0) are wrapped in reprex::reprex because it catches the R crash nicely.
works by specifying join column
doesn't work when one of the joins dfs is in memory
doesn't work when join column in not specified
doesn't work join column is specified by that column is the partition
asfimport commentedon Feb 14, 2022
Will Jones / @wjones127:
Thanks @boshek .
To provide an update: We have identified the issue now and my fix is currently being reviewed. It will likely be included in a 7.0.1 release.
You may be able to workaround the issue by setting
options(arrow.use_threads = TRUE), which will avoid this bug. (However, there are some cases where turning on threads on Windows cause other issues right now, hence why it's off by default on Windows.)asfimport commentedon Feb 14, 2022
Sam Albers / @boshek:
@wjones127 that's great! Does that catch instances where the join columns are partitions? I don't see any tests for that and the reprexes above suggest that might be relevant.
asfimport commentedon Feb 14, 2022
Weston Pace / @westonpace:
Issue resolved by pull request 12339
#12339
asfimport commentedon Feb 14, 2022
Weston Pace / @westonpace:
I went ahead and marked this closed with Will's change but feel free to reopen if either of you decide this doesn't cover all cases.
asfimport commentedon Feb 14, 2022
Will Jones / @wjones127:
Ah it actually does not. I don't think the problem is the partition columns per se; I think the fix i provided works for joining a dataset to an in-memory table, but not a dataset to a dataset. So need to add an additional test for that. Thanks for pointing that out! (y)
@westonpace With a dataset to dataset join we are getting a thread index of 2 now. I guess we have an IO thread per scanner, right? Probably need to modify our approach.
asfimport commentedon Feb 14, 2022
Weston Pace / @westonpace:
Yes, we would have an I/O thread per scanner in that case.
asfimport commentedon Feb 14, 2022
Weston Pace / @westonpace:
Well, we have 8 I/O threads (by default) and each scanner would use a different one of those 8.
asfimport commentedon Feb 15, 2022
Sam Albers / @boshek:
@wjones127 just to close the loop, your fix appears to have sorted out all the cases i outlined. Nice work! For the test, I was thinking something like this: