【发布时间】:2014-10-16 15:02:57
【问题描述】:
我有两个data.tables,主要的一个DT 30M rows 15 cols,一个小的sampleUsers 50k rows 1col。
我正在尝试根据我放入 sampleUsers 的唯一用户的随机样本来过滤大 DT。
DT[sampleUsers] merge(DT,sampleUsers) join(DT,sampleUsers, by = "userID", type = "inner") 都对我不起作用,因为它们会抛出如下错误:
Error in in vecseq(f__, len__, if (allow.cartesian || notjoin) NULL else as.integer(max(nrow(x), :
Join results in more than 2^31 rows (internal vecseq reached physical limit). Very likely misspecified join. Check for duplicate key values in i, each of which join to the same group in x over and over again. [...]
DT 看起来像:
head(DT)
userID time refURL
1: 1 1396914606
2: 1 1397002826
3: 1 1397050230
4: 1 1397158818
5: 100 1397028490 facebook.com
6: 100 1397028498 facebook.com
sampleUsers 看起来像:
head(sampleUsers)
userID myID
1: 1000089045463267792 8948
2: 1000089045463267792 28029
3: 1000226029643951569 22077
4: 1000488257652897256 41877
5: 10012190558163229 8065
6: 1001364147664198715 11842
在 DT 中大约有。 10Mio 唯一 ID(由于不同的时间戳而多次出现。我要做的就是对 50.000 个唯一用户及其在 DT 中的所有条目进行抽样。
对不起,如果这听起来微不足道,但我就是找不到解决方案。 非常感谢您的帮助!
【问题讨论】:
标签: r join data.table