Attached is a data.table with an integer64 column. Data.table returns the correct sum when the by clause is not used. However, when the by clause is used, the result is incorrect. The sum returned is interestingly the sum of the results except the final row.
Related scripts:
> setnames(DT,c("key","value"))
> DT
key value
1: 7355 1100047023 -168067
2: 7355 1100047023 168067
3: 7355 1100047023 141091
4: 7355 1100047023 -141091
> DT[,sum(value)]
integer64
[1] 0
> DT[,sum(value),by=key]
key V1
1: 7355 1100047023 -141091
> save(DT,file="integer64_sum_with_group_example.Rdata")
integer64_sum_with_group_example.zip
Attached is a data.table with an integer64 column. Data.table returns the correct sum when the by clause is not used. However, when the by clause is used, the result is incorrect. The sum returned is interestingly the sum of the results except the final row.
Related scripts:
integer64_sum_with_group_example.zip