[
https://issues.apache.org/jira/browse/TINKERPOP-3099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17946567#comment-17946567
]
Andrea C edited comment on TINKERPOP-3099 at 4/22/25 10:59 PM:
---------------------------------------------------------------
Thanks for the example:
{noformat}
gremlin> b = 100 as byte
==>100
gremlin> g.inject([b,b,b]).sum(local)
==>44{noformat}
This behaviour you're seeing is essentially the same as
https://issues.apache.org/jira/browse/TINKERPOP-3115
was (Author: JIRAUSER308356):
{noformat}
gremlin> b = 100 as byte
==>100
gremlin> g.inject([b,b,b]).sum(local)
==>44{noformat}
Yes this behaviour you're seeing is essentially the same as
https://issues.apache.org/jira/browse/TINKERPOP-3115
> Allow sum() step to specify the result type
> -------------------------------------------
>
> Key: TINKERPOP-3099
> URL: https://issues.apache.org/jira/browse/TINKERPOP-3099
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.6.7, 3.7.2
> Reporter: Valentyn Kahamlyk
> Priority: Major
>
> in some cases `sum()` step do not allow to get the correct result due to
> overflow.
> For example `g.inject(100b,100b,100b).sum()` will lead to
> `ArithmeticException`.
> Good to have a way to get the result using a different type for summation,
> for example by providing seed, `g.inject(100b,100b,100b).sum(0L)` can produce
> 300L
--
This message was sent by Atlassian Jira
(v8.20.10#820010)