You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/07/20 16:03:00 UTC

[jira] [Commented] (TINKERPOP-2011) Use NumberHelper on choose()

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

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

GitHub user dkuppitz opened a pull request:

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

    TINKERPOP-2011 Use NumberHelper on choose()

    https://issues.apache.org/jira/browse/TINKERPOP-2011
    
    Treat numerical options in `ChooseStep` as in any other numerical comparison (value matters, data type does not). It was a little bit trickier than I thought as option values are only used for `HashMap` lookups and not for direct comparisons. Anyway, I think this solution is pretty solid (and easy to extend, should we run into any similar issues in the future).
    
    `docker/build.sh -t -i -n` passed.
    
    VOTE: +1

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

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

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

    https://github.com/apache/tinkerpop/pull/894.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 #894
    
----
commit f7d628e344ff132fca9c4460521a40231aa8acce
Author: Daniel Kuppitz <da...@...>
Date:   2018-07-18T19:34:16Z

    TINKERPOP-2011 Treat numerical options in `ChooseStep` as in any other numerical comparison (value matters, data type does not).

----


> Use NumberHelper on choose()
> ----------------------------
>
>                 Key: TINKERPOP-2011
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2011
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.2.9
>            Reporter: stephen mallette
>            Assignee: Daniel Kuppitz
>            Priority: Minor
>
> The {{choose()} step could use {{NumberHelper}} to make this easier:
> {code}
> gremlin> g.V(1).choose(values('b')).option(b, constant(true)).option(none,constant(false))
> ==>true
> gremlin> g.V(1).choose(values('b')).option(1, constant(true)).option(none,constant(false))
> ==>false
> gremlin> g.V(1).choose(values('b')).option(1 as byte, constant(true)).option(none,constant(false))
> ==>true
> {code}
> as discussed here: https://groups.google.com/d/msg/gremlin-users/4pjH7AOM72s/ohIEdABfBQAJ



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