tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkupp...@apache.org
Subject [tinkerpop] 01/01: Merge branch 'TINKERPOP-2124' into TINKERPOP-2124-master
Date Tue, 08 Jan 2019 22:09:22 GMT
This is an automated email from the ASF dual-hosted git repository.

dkuppitz pushed a commit to branch TINKERPOP-2124-master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 95dbdcaf59445ed7c95e728810211ff80b3b9550
Merge: 7ecbd52 e21f31d
Author: Daniel Kuppitz <daniel_kuppitz@hotmail.com>
AuthorDate: Tue Jan 8 15:09:00 2019 -0700

    Merge branch 'TINKERPOP-2124' into TINKERPOP-2124-master

 CHANGELOG.asciidoc                                                | 3 ++-
 .../traversal/strategy/optimization/InlineFilterStrategy.java     | 8 ++++++--
 .../traversal/strategy/optimization/InlineFilterStrategyTest.java | 1 +
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --cc gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
index 512f6e5,6fffef0..cf54f50
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
@@@ -90,66 -79,57 +90,67 @@@ public class InlineFilterStrategyTest 
      @Parameterized.Parameters(name = "{0}")
      public static Iterable<Object[]> generateTestParameters() {
  
 -        return Arrays.asList(new Traversal[][]{
 -                {has("age", 10).as("a").has("name", "marko").as("b").coin(0.5).as("c"),
addHas(__.start(), "age", eq(10), "name", eq("marko")).as("a", "b").coin(0.5).as("c")},
 +        return Arrays.asList(new Object[][]{
 +                {has("age", 10).as("a").has("name", "marko").as("b").coin(0.5).as("c"),
addHas(__.start(), "age", eq(10), "name", eq("marko")).as("a", "b").coin(0.5).as("c"), Collections.emptyList()},
 +                //
 +                {filter(out("knows")), filter(out("knows")), Collections.emptyList()},
 +                {filter(has("age", gt(10))).as("a"), has("age", gt(10)).as("a"), Collections.emptyList()},
 +                {filter(has("age", gt(10)).as("b")).as("a"), has("age", gt(10)).as("b",
"a"), Collections.emptyList()},
 +                {filter(has("age", gt(10)).as("a")), has("age", gt(10)).as("a"), Collections.emptyList()},
 +                {filter(and(has("age", gt(10)).as("a"), has("name", "marko"))), addHas(__.start(),
"age", gt(10), "name", eq("marko")).as("a"), Collections.emptyList()},
 +                {filter(out("created").and().out("knows").or().in("knows")), filter(or(and(out("created"),
out("knows")), __.in("knows"))), Collections.singletonList(ConnectiveStrategy.instance())},
                  //
 -                {filter(out("knows")), filter(out("knows"))},
 -                {filter(has("age", gt(10))).as("a"), has("age", gt(10)).as("a")},
 -                {filter(has("age", gt(10)).as("b")).as("a"), has("age", gt(10)).as("b",
"a")},
 -                {filter(has("age", gt(10)).as("a")), has("age", gt(10)).as("a")},
 -                {filter(and(has("age", gt(10)).as("a"), has("name", "marko"))), addHas(__.start(),
"age", gt(10), "name", eq("marko")).as("a")},
 +                {or(has("name", "marko"), has("age", 32)), or(has("name", "marko"), has("age",
32)), Collections.emptyList()},
 +                {or(has("name", "marko"), has("name", "bob")), has("name", eq("marko").or(eq("bob"))),
Collections.emptyList()},
 +                {or(has("name", "marko"), has("name")), or(has("name", "marko"), has("name")),
Collections.emptyList()},
 +                {or(has("age", 10), and(has("age", gt(20)), has("age", lt(100)))), has("age",
eq(10).or(gt(20).and(lt(100)))), Collections.emptyList()},
 +                {or(has("name", "marko"), filter(has("name", "bob"))), has("name", eq("marko").or(eq("bob"))),
Collections.emptyList()},
 +                {or(has("name", "marko"), filter(or(filter(has("name", "bob")), has("name",
"stephen")))), has("name", eq("marko").or(eq("bob").or(eq("stephen")))), Collections.emptyList()},
 +                {or(has("name", "marko").as("a"), filter(or(filter(has("name", "bob")).as("b"),
has("name", "stephen").as("c")))), has("name", eq("marko").or(eq("bob").or(eq("stephen")))).as("a",
"b", "c"), Collections.emptyList()},
++                {or(and(has("age",gt(20)), has("age",lt(30))), and(has("age",gt(35)), has("age",lt(40)))),
has("age", gt(20).and(lt(30)).or(gt(35).and(lt(40)))), Collections.emptyList()},
                  //
 -                {or(has("name", "marko"), has("age", 32)), or(has("name", "marko"), has("age",
32))},
 -                {or(has("name", "marko"), has("name", "bob")), has("name", eq("marko").or(eq("bob")))},
 -                {or(has("name", "marko"), has("name")), or(has("name", "marko"), has("name"))},
 -                {or(has("age", 10), and(has("age", gt(20)), has("age", lt(100)))), has("age",
eq(10).or(gt(20).and(lt(100))))},
 -                {or(has("name", "marko"), filter(has("name", "bob"))), has("name", eq("marko").or(eq("bob")))},
 -                {or(has("name", "marko"), filter(or(filter(has("name", "bob")), has("name",
"stephen")))), has("name", eq("marko").or(eq("bob").or(eq("stephen"))))},
 -                {or(has("name", "marko").as("a"), filter(or(filter(has("name", "bob")).as("b"),
has("name", "stephen").as("c")))), has("name", eq("marko").or(eq("bob").or(eq("stephen")))).as("a",
"b", "c")},
 -                {or(and(has("age",gt(20)), has("age",lt(30))), and(has("age",gt(35)), has("age",lt(40)))),
has("age", gt(20).and(lt(30)).or(gt(35).and(lt(40))))},
 +                {has("name", "marko").and().has("name", "marko").and().has("name", "marko"),
has("name", "marko").has("name", "marko").has("name", "marko"), Collections.emptyList()},
 +                {filter(has("name", "marko")).and().filter(has("name", "marko")).and().filter(has("name",
"marko")), has("name", "marko").has("name", "marko").has("name", "marko"), Collections.emptyList()},
 +                {V().has("name", "marko").and().has("name", "marko").and().has("name", "marko"),
V().has("name", "marko").has("name", "marko").has("name", "marko"), Collections.emptyList()},
 +                {V().filter(has("name", "marko")).and().filter(has("name", "marko")).and().filter(has("name",
"marko")), V().has("name", "marko").has("name", "marko").has("name", "marko"), Collections.emptyList()},
 +                {has("name", "marko").and().has("name", "marko").and().has("name", "marko"),
has("name", "marko").has("name", "marko").has("name", "marko"), Collections.singletonList(ConnectiveStrategy.instance())},
 +                {V().filter(has("name", "marko")).and().filter(has("name", "marko")).and().filter(has("name",
"marko")), and(V().has("name", "marko"), has("name", "marko"), has("name", "marko")), Collections.singletonList(ConnectiveStrategy.instance())},
 +                {V().has("name", "marko").and().has("name", "marko").and().has("name", "marko"),
and(V().has("name", "marko"), has("name", "marko"), has("name", "marko")), Collections.singletonList(ConnectiveStrategy.instance())},
 +                {EmptyGraph.instance().traversal().V().filter(has("name", "marko")).and().filter(has("name",
"marko")).and().filter(has("name", "marko")), EmptyGraph.instance().traversal().V().has("name",
"marko").has("name", "marko").has("name", "marko"), Collections.singletonList(ConnectiveStrategy.instance())},
 +                {EmptyGraph.instance().traversal().V().has("name", "marko").and().has("name",
"marko").and().has("name", "marko"), EmptyGraph.instance().traversal().V().has("name", "marko").has("name",
"marko").has("name", "marko"), Collections.singletonList(ConnectiveStrategy.instance())},
                  //
 -                {and(has("age", gt(10)), filter(has("age", 22))), addHas(__.start(), "age",
gt(10), "age", eq(22))},
 -                {and(has("age", gt(10)).as("a"), filter(has("age", 22).as("b")).as("c")).as("d"),
addHas(__.start(), "age", gt(10), "age", eq(22)).as("a", "b", "c", "d")},
 -                {and(has("age", gt(10)).as("a"), and(filter(has("age", 22).as("b")).as("c"),
has("name", "marko").as("d"))), addHas(__.start(), "age", gt(10), "age", eq(22), "name", eq("marko")).as("a",
"b", "c", "d")},
 -                {and(has("age", gt(10)).as("a"), and(has("name", "stephen").as("b"), has("name",
"marko").as("c")).as("d")).as("e"), addHas(__.start(), "age", gt(10), "name", eq("stephen"),
"name", eq("marko")).as("a", "b", "c", "d", "e")},
 -                {and(has("age", gt(10)), and(out("knows"), has("name", "marko"))), has("age",
gt(10)).and(out("knows"), has("name", "marko"))},
 -                {and(has("age", gt(20)), or(has("age", lt(10)), has("age", gt(100)))), addHas(__.start(),
"age", gt(20), "age", lt(10).or(gt(100)))},
 -                {and(has("age", gt(20)).as("a"), or(has("age", lt(10)), has("age", gt(100)).as("b"))),
addHas(__.start(), "age", gt(20), "age", lt(10).or(gt(100))).as("a", "b")},
 -                {and(has("age", gt(20)).as("a"), or(has("age", lt(10)).as("c"), has("age",
gt(100)).as("b"))), addHas(__.start(), "age", gt(20), "age", lt(10).or(gt(100))).as("a", "b",
"c")},
 +                {and(has("age", gt(10)), filter(has("age", 22))), addHas(__.start(), "age",
gt(10), "age", eq(22)), Collections.emptyList()},
 +                {and(has("age", gt(10)).as("a"), filter(has("age", 22).as("b")).as("c")).as("d"),
addHas(__.start(), "age", gt(10), "age", eq(22)).as("a", "b", "c", "d"), Collections.emptyList()},
 +                {and(has("age", gt(10)).as("a"), and(filter(has("age", 22).as("b")).as("c"),
has("name", "marko").as("d"))), addHas(__.start(), "age", gt(10), "age", eq(22), "name", eq("marko")).as("a",
"b", "c", "d"), Collections.emptyList()},
 +                {and(has("age", gt(10)).as("a"), and(has("name", "stephen").as("b"), has("name",
"marko").as("c")).as("d")).as("e"), addHas(__.start(), "age", gt(10), "name", eq("stephen"),
"name", eq("marko")).as("a", "b", "c", "d", "e"), Collections.emptyList()},
 +                {and(has("age", gt(10)), and(out("knows"), has("name", "marko"))), has("age",
gt(10)).and(out("knows"), has("name", "marko")), Collections.emptyList()},
 +                {and(has("age", gt(20)), or(has("age", lt(10)), has("age", gt(100)))), addHas(__.start(),
"age", gt(20), "age", lt(10).or(gt(100))), Collections.emptyList()},
 +                {and(has("age", gt(20)).as("a"), or(has("age", lt(10)), has("age", gt(100)).as("b"))),
addHas(__.start(), "age", gt(20), "age", lt(10).or(gt(100))).as("a", "b"), Collections.emptyList()},
 +                {and(has("age", gt(20)).as("a"), or(has("age", lt(10)).as("c"), has("age",
gt(100)).as("b"))), addHas(__.start(), "age", gt(20), "age", lt(10).or(gt(100))).as("a", "b",
"c"), Collections.emptyList()},
                  //
 -                {V().match(as("a").has("age", 10), as("a").filter(has("name")).as("b")),
V().has("age", 10).as("a").match(as("a").has("name").as("b"))},
 -                {match(as("a").has("age", 10), as("a").filter(has("name")).as("b")), match(as("a").has("age",
10), as("a").has("name").as("b"))},
 -                {match(as("a").has("age", 10).both().as("b"), as("b").out().as("c")), match(as("a").has("age",
10).both().as("b"), as("b").out().as("c"))},
 -                {__.map(match(as("a").has("age", 10), as("a").filter(has("name")).as("b"))),
__.map(match(as("a").has("age", 10), as("a").has("name").as("b")))},
 -                {V().match(as("a").has("age", 10)), V().has("age", 10).as("a")},
 -                {V().match(as("a").has("age", 10).has("name", "marko").as("b")), V().has("age",
10).has("name", "marko").as("a", "b")},
 -                {V().match(as("a").has("age", 10).has("name", "marko").as("b"), as("a").out("knows").as("c")),
V().has("age", 10).has("name", "marko").as("a", "b").match(as("a").out("knows").as("c"))},
 -                {V().match(as("a").out("knows").as("c"), as("a").has("age", 10).has("name",
"marko").as("b")), V().has("age", 10).has("name", "marko").as("a", "b").match(as("a").out("knows").as("c"))},
 -                {V().match(as("a").out("knows").as("c"), as("a").has("age", 10).has("name",
"marko").as("b"), as("a").has("name", "bob")), V().has("age", 10).has("name", "marko").has("name",
"bob").as("a", "b").match(as("a").out("knows").as("c"))},
 -                {V().match(as("a").has("age", 10).as("b"), as("a").filter(has("name")).as("b")),
V().has("age", 10).as("a", "b").match(as("a").has("name").as("b"))},
 +                {V().match(as("a").has("age", 10), as("a").filter(has("name")).as("b")),
V().has("age", 10).as("a").match(as("a").has("name").as("b")), Collections.emptyList()},
 +                {match(as("a").has("age", 10), as("a").filter(has("name")).as("b")), match(as("a").has("age",
10), as("a").has("name").as("b")), Collections.emptyList()},
 +                {match(as("a").has("age", 10).both().as("b"), as("b").out().as("c")), match(as("a").has("age",
10).both().as("b"), as("b").out().as("c")), Collections.emptyList()},
 +                {__.map(match(as("a").has("age", 10), as("a").filter(has("name")).as("b"))),
__.map(match(as("a").has("age", 10), as("a").has("name").as("b"))), Collections.emptyList()},
 +                {V().match(as("a").has("age", 10)), V().has("age", 10).as("a"), Collections.emptyList()},
 +                {V().match(as("a").has("age", 10).has("name", "marko").as("b")), V().has("age",
10).has("name", "marko").as("a", "b"), Collections.emptyList()},
 +                {V().match(as("a").has("age", 10).has("name", "marko").as("b"), as("a").out("knows").as("c")),
V().has("age", 10).has("name", "marko").as("a", "b").match(as("a").out("knows").as("c")),
Collections.emptyList()},
 +                {V().match(as("a").out("knows").as("c"), as("a").has("age", 10).has("name",
"marko").as("b")), V().has("age", 10).has("name", "marko").as("a", "b").match(as("a").out("knows").as("c")),
Collections.emptyList()},
 +                {V().match(as("a").out("knows").as("c"), as("a").has("age", 10).has("name",
"marko").as("b"), as("a").has("name", "bob")), V().has("age", 10).has("name", "marko").has("name",
"bob").as("a", "b").match(as("a").out("knows").as("c")), Collections.emptyList()},
 +                {V().match(as("a").has("age", 10).as("b"), as("a").filter(has("name")).as("b")),
V().has("age", 10).as("a", "b").match(as("a").has("name").as("b")), Collections.emptyList()},
                  //
 -                {filter(dedup()), filter(dedup())},
 -                {filter(filter(drop())), filter(drop())},
 -                {and(has("name"), limit(10).has("age")), and(has("name"), limit(10).has("age"))},
 -                {filter(tail(10).as("a")), filter(tail(10).as("a"))},
 +                {filter(dedup()), filter(dedup()), Collections.emptyList()},
 +                {filter(filter(drop())), filter(drop()), Collections.emptyList()},
 +                {and(has("name"), limit(10).has("age")), and(has("name"), limit(10).has("age")),
Collections.emptyList()},
 +                {filter(tail(10).as("a")), filter(tail(10).as("a")), Collections.emptyList()},
                  //
 -                {outE().hasLabel("knows").inV(), outE("knows").inV()},
 -                {outE().hasLabel("knows").hasLabel("created").inV(), outE("knows").hasLabel("created").inV()},
 -                {outE().or(hasLabel("knows"), hasLabel("created")).inV(), outE("knows",
"created").inV()},
 -                {outE().or(hasLabel("knows").as("a"), hasLabel("created").as("b")).as("c").inV(),
outE("knows", "created").as("a", "b", "c").inV()},
 -                {outE().hasLabel(P.eq("knows").or(P.gt("created"))).has("weight", gt(1.0)).inV(),
addHas(outE(), T.label.getAccessor(), P.eq("knows").or(P.gt("created")), "weight", gt(1.0)).inV()},
 -                {outE().hasLabel(P.eq("knows").or(P.eq("created"))).has("weight", gt(1.0)).inV(),
outE("knows", "created").has("weight", gt(1.0)).inV()},
 -                // {outE().or(has(T.label,P.within("knows","likes")).hasLabel("created")).inV(),
outE("knows", "likes", "created").inV()},
 -                {outE().hasLabel(P.within("knows", "created")).inV(), outE("knows", "created").inV()},
 +                {outE().hasLabel("knows").inV(), outE("knows").inV(), Collections.emptyList()},
 +                {outE().hasLabel("knows").hasLabel("created").inV(), outE("knows").hasLabel("created").inV(),
Collections.emptyList()},
 +                {outE().or(hasLabel("knows"), hasLabel("created")).inV(), outE("knows",
"created").inV(), Collections.emptyList()},
 +                {outE().or(hasLabel("knows").as("a"), hasLabel("created").as("b")).as("c").inV(),
outE("knows", "created").as("a", "b", "c").inV(), Collections.emptyList()},
 +                {outE().hasLabel(P.eq("knows").or(P.gt("created"))).has("weight", gt(1.0)).inV(),
addHas(outE(), T.label.getAccessor(), P.eq("knows").or(P.gt("created")), "weight", gt(1.0)).inV(),
Collections.emptyList()},
 +                {outE().hasLabel(P.eq("knows").or(P.eq("created"))).has("weight", gt(1.0)).inV(),
outE("knows", "created").has("weight", gt(1.0)).inV(), Collections.emptyList()},
 +                {outE().hasLabel(P.within("knows", "created")).inV(), outE("knows", "created").inV(),
Collections.emptyList()},
          });
      }
  


Mime
View raw message