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

ASF GitHub Bot commented on TINKERPOP-1873:
-------------------------------------------

GitHub user dkuppitz opened a pull request:

    https://github.com/apache/tinkerpop/pull/786

    https://issues.apache.org/jira/browse/TINKERPOP-1873

    
    
    Made the reducer for `min()` and `max()` not depend on an Integer seed 
value. It now uses `Double.NaN` again, but `Double.NaN` also got some special 
handling in `NumberHelper`, so that results for the reducing steps are not 
forced to be of type `Double`.
    
    ```
    $ docker/build.sh -t -i
    ...
    [INFO] 
------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO] 
    [INFO] Apache TinkerPop ................................... SUCCESS [02:18 
min]
    [INFO] Apache TinkerPop :: Gremlin Shaded ................. SUCCESS [ 
21.891 s]
    [INFO] Apache TinkerPop :: Gremlin Core ................... SUCCESS [01:26 
min]
    [INFO] Apache TinkerPop :: Gremlin Test ................... SUCCESS [ 
12.415 s]
    [INFO] Apache TinkerPop :: TinkerGraph Gremlin ............ SUCCESS [04:54 
min]
    [INFO] Apache TinkerPop :: Gremlin Groovy ................. SUCCESS [06:38 
min]
    [INFO] Apache TinkerPop :: Gremlin Driver ................. SUCCESS [01:32 
min]
    [INFO] Apache TinkerPop :: Neo4j Gremlin .................. SUCCESS [  
2.254 s]
    [INFO] Apache TinkerPop :: Gremlin Server ................. SUCCESS [20:40 
min]
    [INFO] Apache TinkerPop :: Gremlin Python ................. SUCCESS [02:56 
min]
    [INFO] Apache TinkerPop :: Gremlin.Net .................... SUCCESS [  
8.125 s]
    [INFO] Apache TinkerPop :: Gremlin.Net - Source ........... SUCCESS [01:25 
min]
    [INFO] Apache TinkerPop :: Gremlin.Net - Tests ............ SUCCESS [01:39 
min]
    [INFO] Apache TinkerPop :: Hadoop Gremlin ................. SUCCESS [43:51 
min]
    [INFO] Apache TinkerPop :: Spark Gremlin .................. SUCCESS [29:59 
min]
    [INFO] Apache TinkerPop :: Giraph Gremlin ................. SUCCESS [  
01:32 h]
    [INFO] Apache TinkerPop :: Gremlin Console ................ SUCCESS [05:07 
min]
    [INFO] Apache TinkerPop :: Gremlin Archetype .............. SUCCESS [  
0.276 s]
    [INFO] Apache TinkerPop :: Archetype - TinkerGraph ........ SUCCESS [ 
37.653 s]
    [INFO] Apache TinkerPop :: Archetype - Server ............. SUCCESS [ 
23.353 s]
    [INFO] Apache TinkerPop :: Archetype - DSL ................ SUCCESS [ 
10.614 s]
    [INFO] Apache TinkerPop :: Gremlin Tools .................. SUCCESS [  
0.665 s]
    [INFO] Apache TinkerPop :: Gremlin Benchmark .............. SUCCESS [  
9.298 s]
    [INFO] Apache TinkerPop :: Gremlin Coverage ............... SUCCESS [  
1.239 s]
    [INFO] Apache TinkerPop :: Gremlin IO Test ................ SUCCESS [  
7.817 s]
    [INFO] 
------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] 
------------------------------------------------------------------------
    [INFO] Total time: 03:37 h
    [INFO] Finished at: 2018-01-20T14:35:57+00:00
    [INFO] Final Memory: 196M/1606M
    [INFO] 
------------------------------------------------------------------------
    ```
    
    VOTE: +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1873

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/786.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #786
    
----
commit 404d115b7066c53d14a36776c8a374e1bad5dfbb
Author: Daniel Kuppitz <daniel_kuppitz@...>
Date:   2018-01-21T00:50:55Z

    Made the reducer for `min()` and `max()` not depend on an Integer seed 
value. It now uses `Double.NaN` again, but `Double.NaN`
    also got some special handling in `NumberHelper`, so that results for the 
reducing steps are not forced to be of type `Double`.

----


> min() and max() work only in the range of Integer values
> --------------------------------------------------------
>
>                 Key: TINKERPOP-1873
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1873
>             Project: TinkerPop
>          Issue Type: Bug
>    Affects Versions: 3.3.1
>            Reporter: Rado Kozmer
>            Assignee: Daniel Kuppitz
>            Priority: Major
>
> Following examples show the problem. The Min and Max steps are seeded with 
> Integer.MIN_VALUE and Integer.MAX_VALUE. This is not high/low enough for long 
> and double values.
> {{g.V(0).values().inject(9999999999).min()}}
> returns 2147483647 instead of 9999999999.
> {{g.V(0).values().inject(-9999999999).max()}}
> returns -2147483648 instead of -9999999999.
> Extremes like -Double.MAX_VALUE and Double.MAX_VALUE should solve the 
> problem, but I see some casting issues in the MinGlobalStep, MaxGlobalStep, 
> MinLocalStep, MaxLocalStep.
> Can anybody help with this?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to