Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 82319200BE3 for ; Wed, 16 Nov 2016 13:48:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 81087160B03; Wed, 16 Nov 2016 12:48:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 45AC2160B31 for ; Wed, 16 Nov 2016 13:48:24 +0100 (CET) Received: (qmail 63271 invoked by uid 500); 16 Nov 2016 12:48:23 -0000 Mailing-List: contact commits-help@tinkerpop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tinkerpop.apache.org Delivered-To: mailing list commits@tinkerpop.apache.org Received: (qmail 62849 invoked by uid 99); 16 Nov 2016 12:48:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Nov 2016 12:48:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 40AD8E2F01; Wed, 16 Nov 2016 12:48:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: okram@apache.org To: commits@tinkerpop.apache.org Date: Wed, 16 Nov 2016 12:48:48 -0000 Message-Id: <510f952156474d24904f98b416b2abdc@git.apache.org> In-Reply-To: <1e145e44aa3e4606b080f97fad04dc89@git.apache.org> References: <1e145e44aa3e4606b080f97fad04dc89@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [27/29] tinkerpop git commit: fixed a FilterRankStrategy bug that was introduced with where().by(). Added test cases to verify behavior. Updated CHANGELOG. archived-at: Wed, 16 Nov 2016 12:48:26 -0000 fixed a FilterRankStrategy bug that was introduced with where().by(). Added test cases to verify behavior. Updated CHANGELOG. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/248ccc68 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/248ccc68 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/248ccc68 Branch: refs/heads/TINKERPOP-1502 Commit: 248ccc685720535e93b1b2ac3adc94443e697c68 Parents: 0d4ee56 Author: Marko A. Rodriguez Authored: Tue Nov 15 12:10:22 2016 -0700 Committer: Marko A. Rodriguez Committed: Wed Nov 16 05:44:18 2016 -0700 ---------------------------------------------------------------------- CHANGELOG.asciidoc | 5 +++++ .../optimization/FilterRankingStrategy.java | 12 +++++++----- .../optimization/FilterRankingStrategyTest.java | 3 +++ .../traversal/step/filter/GroovyWhereTest.groovy | 5 +++++ .../process/traversal/step/filter/WhereTest.java | 16 ++++++++++++++++ 5 files changed, 36 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/248ccc68/CHANGELOG.asciidoc ---------------------------------------------------------------------- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 7c4d41f..0613a39 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -27,6 +27,11 @@ TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Converted Spark process suite tests to "integration" tests. +* Fixed a bug in `InlineFilterStrategy` having to do with folding `HasContainers` into `VertexStep`. +* Deprecated `HasContainer.makeHasContainers()` which was used to dissect `AndP` and shouldn't be used at the TinkerPop-level. +* `GraphTraversal.has()` now will try and fold-left `HasContainer` if end step is a `HasContainerHolder`. +* Created explicit `P`-predicate methods for `GraphTraversal.hasXXX()`. +* Fixed a bug in `FilterRankStrategy` around `where().by()` ordering. * Added another optimization in `RangeByIsCountStrategy`, that removes `count().is()` altogether if it's not needed. * Fixed a OLAP `MatchStep.clone()`-bug that occurs when the `match()` is in a local child. * Added another optimization in `RangeByIsCountStrategy`, that removes `count().is()` altogether if it's not needed. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/248ccc68/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java index 2f8061b..4ff485a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java @@ -126,7 +126,7 @@ public final class FilterRankingStrategy extends AbstractTraversalStrategy(g, "gremlin-groovy", "g.V().as('a').outE('created').as('b').inV().as('c').in('created').as('d').where('a', lt('b').or(gt('c')).and(neq('d'))).by('age').by('weight').by(__.in('created').values('age').min()).select('a', 'c', 'd').by('name')") } + @Override + public Traversal get_g_VX1X_asXaX_out_hasXageX_whereXgtXaXX_byXageX_name(final Object v1Id) { + new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out.has('age').where(gt('a')).by('age').name", "v1Id", v1Id) + } + } } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/248ccc68/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereTest.java ---------------------------------------------------------------------- diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereTest.java index ef2a5e4..c9a25ad 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereTest.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereTest.java @@ -119,6 +119,8 @@ public abstract class WhereTest extends AbstractGremlinProcessTest { public abstract Traversal> get_g_V_asXaX_outEXcreatedX_asXbX_inV_asXcX_inXcreatedX_asXdX_whereXa_ltXbX_orXgtXcXX_andXneqXdXXX_byXageX_byXweightX_byXinXcreatedX_valuesXageX_minX_selectXa_c_dX(); + public abstract Traversal get_g_VX1X_asXaX_out_hasXageX_whereXgtXaXX_byXageX_name(final Object v1Id); + @Test @LoadGraphWith(MODERN) public void g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXa_eqXbXX() { @@ -385,6 +387,15 @@ public abstract class WhereTest extends AbstractGremlinProcessTest { "a", "josh", "c", "lop", "d", "peter"), traversal); } + @Test + @LoadGraphWith(MODERN) + public void g_VX1X_asXaX_out_hasXageX_whereXgtXaXX_byXageX_name() { + final Traversal traversal = get_g_VX1X_asXaX_out_hasXageX_whereXgtXaXX_byXageX_name(convertToVertexId(graph, "marko")); + printTraversalForm(traversal); + assertEquals("josh", traversal.next()); + assertFalse(traversal.hasNext()); + } + public static class Traversals extends WhereTest { @@ -504,5 +515,10 @@ public abstract class WhereTest extends AbstractGremlinProcessTest { public Traversal> get_g_V_asXaX_outEXcreatedX_asXbX_inV_asXcX_inXcreatedX_asXdX_whereXa_ltXbX_orXgtXcXX_andXneqXdXXX_byXageX_byXweightX_byXinXcreatedX_valuesXageX_minX_selectXa_c_dX() { return g.V().as("a").outE("created").as("b").inV().as("c").in("created").as("d").where("a", lt("b").or(gt("c")).and(neq("d"))).by("age").by("weight").by(in("created").values("age").min()).select("a", "c", "d").by("name"); } + + @Override + public Traversal get_g_VX1X_asXaX_out_hasXageX_whereXgtXaXX_byXageX_name(final Object v1Id) { + return g.V(v1Id).as("a").out().has("age").where(gt("a")).by("age").values("name"); + } } } \ No newline at end of file