tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [02/13] incubator-tinkerpop git commit: minor bug fix where if the filter has both() and a non-generic out() or in(), duplicate edges emerge from GraphFilterAwareInputFormat. Makes sense --- just needed to be more strict in GraphFilterStrategy.
Date Thu, 12 May 2016 13:14:22 GMT
minor bug fix where if the filter has both() and a non-generic out() or in(), duplicate edges
emerge from GraphFilterAwareInputFormat. Makes sense --- just needed to be more strict in
GraphFilterStrategy.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/c6238c0c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/c6238c0c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/c6238c0c

Branch: refs/heads/TINKERPOP-1281
Commit: c6238c0c000c202292be33c3c2656c0694a4cc71
Parents: edd2f96
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Fri May 6 16:19:00 2016 -0600
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Fri May 6 16:19:00 2016 -0600

----------------------------------------------------------------------
 .../strategy/optimization/GraphFilterStrategy.java        | 10 +++++-----
 .../strategy/optimization/GraphFilterStrategyTest.java    |  3 ---
 2 files changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6238c0c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java
index eea33ed..4ccf476 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java
@@ -124,14 +124,14 @@ public final class GraphFilterStrategy extends AbstractTraversalStrategy<Travers
                 return __.<Vertex>outE(outs).asAdmin();
             else if (outLabels.isEmpty() && bothLabels.isEmpty())
                 return __.<Vertex>inE(ins).asAdmin();
-            else if (outLabels.isEmpty())
-                return __.<Vertex, Edge>union(__.inE(ins), __.bothE(boths)).asAdmin();
-            else if (inLabels.isEmpty())
-                return __.<Vertex, Edge>union(__.outE(outs), __.bothE(boths)).asAdmin();
             else if (bothLabels.isEmpty())
                 return __.<Vertex, Edge>union(__.inE(ins), __.outE(outs)).asAdmin();
+            else if (outLabels.isEmpty() && ins.length > 0)
+                return __.<Vertex, Edge>union(__.inE(ins), __.bothE(boths)).asAdmin();
+            else if (inLabels.isEmpty() && outs.length > 0)
+                return __.<Vertex, Edge>union(__.outE(outs), __.bothE(boths)).asAdmin();
             else
-                return null;  // no filter
+                return null;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6238c0c/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategyTest.java
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategyTest.java
index de812e0..e2deeed 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategyTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategyTest.java
@@ -66,9 +66,6 @@ public class GraphFilterStrategyTest {
                 {__.union(__.inE("created"), __.outE("created")), __.bothE("created")},
                 {__.union(__.inE("knows"), __.outE("created")), __.union(__.outE("created"),
__.bothE("knows"))},
                 {__.union(__.inE("knows", "created"), __.outE("created")), __.bothE("knows",
"created")},
-                {__.V().match(
-                        as("a").in("created").as("b"),
-                        as("b").in("knows").as("c")).select("c").out("created").values("name"),
__.union(__.inE("knows"), __.bothE("created"))},
                 {__.V().out().out().match(
                         as("a").in("created").as("b"),
                         as("b").in("knows").as("c")).select("c").out("created").values("name"),
null}


Mime
View raw message