Daniel Kuppitz commented on TINKERPOP-1777:

Hmm, with the latest changes it returns {{NaN}} for empty traversers and does 
throw an exception for non-numeric types.

gremlin> g.V().values('age').max()
gremlin> g.V().values('weight').max()
gremlin> g.V().values('name').max()
java.lang.String cannot be cast to java.lang.Number

I wouldn't want to make any more changes  in {{NumberHelper}}, but I'd be good 
with the respective steps throwing {{FastNoSuchElementExceptions}}, in case 
{{NumberHelper}} returns {{NaN}}.

Now, after doing a few tests, I'm also wondering why this is happening:

gremlin> __.inject(Double.NaN).max()

> Gremlin .max step returns -2147483648 for empty result sets
> -----------------------------------------------------------
>                 Key: TINKERPOP-1777
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1777
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.2.6
>            Reporter: Sebastian Estevez
>            Priority: Major
> To reproduce:
> {code}gremlin> g.V().values('test').max()
> ==>-2147483648{code}
> This should probably return an exeption, "cannot take max of nothing"

This message was sent by Atlassian JIRA

Reply via email to