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 2016/09/29 16:48:20 UTC

[jira] [Commented] (TINKERPOP-1470) InlineFilterStrategy should try and P.or() has() children in OrSteps.

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

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

GitHub user okram opened a pull request:

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

    TINKERPOP-1470: InlineFilterStrategy should try and P.or() has() children in OrSteps.

    https://issues.apache.org/jira/browse/TINKERPOP-1470
    
    Added `InlineFilterStrategy` support for:
    
    ```
    OrStep[HasStep(x,p1),HasStep(y,p2)]
    ```
    
    to be rewritten as:
    
    ```
    HasStep(x,p1.or(p2)))
    ```
    
    While doing this, I found a bug in `ConnectiveP` around nesting predicates that should be inlined. I added upgrade notes about `ConnectiveP` as well as about hidden step labels (forgot to add this from a previous ticket).
    
    Also, I added this ticket as future work: https://issues.apache.org/jira/browse/TINKERPOP-1482
    
    VOTE +1

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

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

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

    https://github.com/apache/tinkerpop/pull/445.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 #445
    
----
commit 6da9151ef19c998688b78309e69fddb274ddf9d6
Author: Marko A. Rodriguez <ok...@gmail.com>
Date:   2016-09-29T16:39:20Z

    Added support for or(has(x),has(y)) to be has(x.or(y)) in InlineFilterStrategy. While doing this, I found a bug in ConnectiveP steps where nested equivalents were not being inlined. That bug has been fixed. Added test cases to PTest to demonstrate proper inlining and nesting of ConnectivePs. I left two TODOs. One regarding match()-pulls that are labeled (interfering with FilterRankStrategy) and one regarding, has(x).has(y) being turned into has(x.and(y)). The reason why the latter isn't done now as it may greatly mess up providers who just rely on eq() for index lookups and are not smart enough to look into and()/or() predicates.

----


> InlineFilterStrategy should try and P.or() has() children in OrSteps.
> ---------------------------------------------------------------------
>
>                 Key: TINKERPOP-1470
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1470
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.2.2
>            Reporter: Marko A. Rodriguez
>            Assignee: Marko A. Rodriguez
>
> The following patterns:
> {code}
> g.V().or(has("age",gt(20)), has("age",lt(32)))
> g.V().and(or(has("age",gt(20)), has("age",lt(32))),has("age",neq(23))
> {code}
> should be re-written by {{InlineFilterStrategy}} as:
> {code}
> g.V().has("age",gt(20).or(lt(32)))
> g.V().has("age",gt(20).or(lt(32)).and(neq(23)))
> {code}
> This would then make it easier for provider strategies to fold the predicate into graph/vertex-centric push down predicates accordingly.
> Note that {{InlineFilterStep}} already has the code to flatten {{AndSteps}}. Thus, during its recursion, it would do the following rewrites to get to the final form.
> {code}
> g.V().and(or(has("age",gt(20)), has("age",lt(32))),has("age",neq(23))
> g.V().or(has("age",gt(20)), has("age",lt(32))).has("age",neq(23))
> g.V().has("age",gt(20).or(lt(32))).has("age",neq(23))
> g.V().has("age",gt(20).or(lt(32)).and(neq(23)))
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)