[ 
https://issues.apache.org/jira/browse/TINKERPOP-3099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17956251#comment-17956251
 ] 

Valentyn Kahamlyk commented on TINKERPOP-3099:
----------------------------------------------

I think that solution from TINKERPOP-3115 is quite good for now.
I guess I was thinking about scheme when I suggested option with the seed, for 
use cases like

{code:java}
gremlin> g.addV().property("age", 61 as byte)
==>v[98]
gremlin> g.addV().property("age", 70 as byte)
==>v[100]
gremlin> g.addV().property("sum_age", __.V().values("age").sum())
==>v[102]
gremlin> g.V(102).values("sum_age").next().class
==>class java.lang.Long{code}
when `sum_age` is defined as float in schema.

I think we can close this ticket and return to the problem when/if there is 
graph scheme.

 
 
 
 

 

> 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)

Reply via email to