You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/02/16 20:15:42 UTC
[jira] [Commented] (TINKERPOP-1554) has(propertyKey) should have a
corresponding step in Gremlin-Java.
[ https://issues.apache.org/jira/browse/TINKERPOP-1554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15870629#comment-15870629 ]
ASF GitHub Bot commented on TINKERPOP-1554:
-------------------------------------------
GitHub user okram opened a pull request:
https://github.com/apache/tinkerpop/pull/560
TINKERPOP-1554: has(propertyKey) should have a corresponding step in Gremlin-Java.
https://issues.apache.org/jira/browse/TINKERPOP-1554
Currently `has('name')` compiles to `filter(values('name'))`. Its a used enough "step" that it should really have its own direct step compilation for efficiency, understability, and ease of strategy manipulation.
VOTE +1.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1554
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/560.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #560
----
commit 6fa8aa6bb0504ba5e3408a0fb7a5df31b26912ac
Author: Marko A. Rodriguez <ok...@gmail.com>
Date: 2017-02-16T20:13:24Z
added HasPropertyStep so has(key) no longer compiles to filter(values(key)). Its a used enough step that it should really have its own direct step compilation.
----
> has(propertyKey) should have a corresponding step in Gremlin-Java.
> ------------------------------------------------------------------
>
> Key: TINKERPOP-1554
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1554
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.2.3
> Reporter: Marko A. Rodriguez
> Assignee: Marko A. Rodriguez
>
> Currently {{has('name')}} compiles to {{filter(values('name'))}}. This is bad for a few reasons:
> 1. Its slower than a direct step.
> 2. Its nested traversals which increases reasoning time of strategies.
> 3. Its not clear from bytecode what it going on.
> I propose:
> {code}
> public class HasPropertyStep<S extends Element> implements FilterStep<S> {
> private String propertyKey;
> public boolean filter(final Traverser.Admin<S> traverser) {
> return traverser.get().properties(propertyKey).hasNext();
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)