You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Andrea C (Jira)" <ji...@apache.org> on 2025/01/15 18:22:00 UTC
[jira] [Commented] (TINKERPOP-3099) Allow sum() step to specify the result type
[ https://issues.apache.org/jira/browse/TINKERPOP-3099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17913412#comment-17913412 ]
Andrea C commented on TINKERPOP-3099:
-------------------------------------
Some things to consider:
* whatever fix we do for sum should be made consistent with other related steps such as math
** check for recent changes in master that were made to handle similar issue with other steps
* needs to be done in 4.0 if we decide to auto convert the type (instead of adding a parameter to specify the output type) if overflow will happen as that would be a breaking change
> 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)