首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >integer64密钥的联接错误

integer64密钥的联接错误
EN

Stack Overflow用户
提问于 2013-10-23 19:39:25
回答 1查看 535关注 0票数 4

在尝试连接以integer64值作为主键的列的表时,我遇到意外错误。下面说明了这些问题--

代码语言:javascript
复制
Keys as int
-----------
x <- data.table(c1=c(1,2,3), c3=c(10,20,30))
z <- data.table(c1=c(1,2), c2=c(100,200))

setkey(x, c1)
setkey(z, c1)

> z[x]          # Join works fine

   c1  c2 c3
1:  1 100 10
2:  2 200 20
3:  3  NA 30


As integer64
------------

library(bit64)
x[,c1:=as.integer64(c1)]
z[,c1:=as.integer64(c1)]

setkey(x, c1)
setkey(z, c1)

> z[x]       # Same join, but generates error message

Error in vecseq(f__, len__, if (allow.cartesian) NULL else as.integer(max(nrow(x),  : 
Join results in 6 rows; more than 3 = max(nrow(x),nrow(i)). Check for duplicate key values 
in i, each of which join to the same group in x over and over again. If that's ok, try 
including `j` and dropping `by` (by-without-by) so that j runs for each group to avoid the 
large allocation. If you are sure you wish to proceed, rerun with allow.cartesian=TRUE. 
Otherwise, please search for this error message in the FAQ, Wiki, Stack Overflow and 
datatable-help for advice.

你对这个问题有什么想法吗?我在更大的表上也得到了同样的错误。作为一种解决办法,我不得不将integer64值转换为字符,然后它就可以正常工作了。

代码语言:javascript
复制
> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

... 
other attached packages:
[1] bit64_0.9-2       bit_1.1-10        cluster_1.14.4    skmeans_0.2-4     ggplot2_0.9.3.1  
[6] data.table_1.8.11

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2015-01-16 20:47:14

只是为了回答一个公开的问题。现在已经按照预期(1.9.5)进行了处理。

对integer64列的联接与对数值字段的联接返回相同的结果。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19540618

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档