Skip to content

Inaccurate sum of integer64 returned using by clause #1647

@mlandry22-h2o

Description

@mlandry22-h2o

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

Metadata

Metadata

Assignees

Labels

GForceissues relating to optimized grouping calculations (GForce)bit64bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions