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

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

GitHub user dkuppitz opened a pull request:

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

    TINKERPOP-2058 Contains predicates should rely on Compare predicates

    https://issues.apache.org/jira/browse/TINKERPOP-2058
    
    If the object to be filtered is a number, `Contains` predicates will now 
scan the provided collection, comparing each element using `Compare.eq`. For 
non-numeric values `Contains.within` will still use `collection.contains()` in 
order to make use of search-optimized data types (e.g. `Set`).
    
    This is a breaking change as the test suite previously ensured that number 
types had an effect on `Contains` predicates. This, however, was inconsistent 
with `Compare` predicates which ignore the number type.
    
    `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-2058

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

    https://github.com/apache/tinkerpop/pull/950.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 #950
    
----
commit ec0d8805fe18e6d1985af5544106f78169f3f5b4
Author: Daniel Kuppitz <daniel_kuppitz@...>
Date:   2018-10-04T14:15:09Z

    TINKERPOP-2058 Use `Compare.eq` in `Contains.within` to ensure equal filter 
behaviors.
    
    If the object to be filtered is a number, `Contains` predicates will now 
scan the provided collection, comparing
    each element using `Compare.eq`. For non-numeric values `Contains.within` 
will still use `collection.contains()`
    in order to make use of search-optimized data types (e.g. `Set`).

----


> Contains predicates should rely on Compare predicates
> -----------------------------------------------------
>
>                 Key: TINKERPOP-2058
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2058
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.4.0
>            Reporter: Daniel Kuppitz
>            Assignee: Daniel Kuppitz
>            Priority: Major
>              Labels: breaking
>
> The problem:
> {noformat}
> gremlin> g.V().has("age", eq(32L))
> ==>v[4]
> gremlin> g.V().has("age", within(32L, 35L))
> gremlin> 
> {noformat}
> {{Contains}} predicates should really behave the same way {{Compare}} 
> predicates do.



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

Reply via email to