Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1470

InlineFilterStrategy should try and P.or() has() children in OrSteps.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.2
    • Fix Version/s: 3.2.3
    • Component/s: process
    • Labels:
      None

      Description

      The following patterns:

      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))
      

      should be re-written by InlineFilterStrategy as:

      g.V().has("age",gt(20).or(lt(32)))
      g.V().has("age",gt(20).or(lt(32)).and(neq(23)))
      

      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.

      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)))
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                okram Marko A. Rodriguez
                Reporter:
                okram Marko A. Rodriguez
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: