You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Marko A. Rodriguez (JIRA)" <ji...@apache.org> on 2016/09/26 15:30:20 UTC

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

Marko A. Rodriguez created TINKERPOP-1470:
---------------------------------------------

             Summary: 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


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)