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
then I tried doing it in this way: c <- a %>% left_join(b, merge_by_chunk_id = TRUE)
firstly, it used the whole (62.8 GB) of my ram, then returned an error:
Error in unserialize(node$con) :
Failed to retrieve the value of MultisessionFuture (future_mapply-1) from cluster RichSOCKnode #1 (PID 25440 on localhost ‘localhost’). The reason reported was ‘error reading from connection’. Post-mortem diagnostic: A process with this PID exists, which suggests that the localhost worker is still alive.
and didn't do the join!
I also tested it with: setup_disk.frame(workers = 16)
same result!
just to mention that I have done some joins on my other data.frames and they were done successfully but this one (which is only greater than the other data.frames) failed.
could you please help me to understand what the problem is?
I suspect your left join has a lot of duplicate keys. For example, if i generate a and b as below
library(disk.frame)
setup_disk.frame()
a = data.frame(
id = sample(1:8, 2127625, replace=TRUE)
)
b = data.frame(
id = sample(1:8, 73364, replace=TRUE)
)
library(dplyr)
left_join(a, b)
This would also fail to join on my computer and it's allocating 72.7GB of RAM.
You can't improve the situation by having more workers, but you might be able to fix the issue by having fewer workers and working on smaller chunks like this.
setup_disk.frame(workers = 4) # reduce to 1 if still not working since the more worker you have the more memory it uses
a = as.disk.frame(a)
b = as.disk.frame(b)
nchunks_for_merge = max(nchunks(a), nchunks(b))
# double the number of chunks and shard by the merge key which is "id" in my case
a = rechunk(a, nchunks=nchunks_for_merge*2, shardby = "id")
b = rechunk(b, nchunks=nchunks_for_merge*2, shardby = "id")
nc = max(nchunks(a), nchunks(b))
#setup_disk.frame(workers=1) # if necessary
system.time(ab <- left_join(a, b, merge_by_chunk_id=TRUE))
Activity
xiaodaigh commentedon Sep 11, 2021
I suspect your left join has a lot of duplicate keys. For example, if i generate
aandbas belowThis would also fail to join on my computer and it's allocating 72.7GB of RAM.
You can't improve the situation by having more workers, but you might be able to fix the issue by having fewer workers and working on smaller chunks like this.