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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.2
    • 3.2.3
    • process
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: