You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Jermy Li (Jira)" <ji...@apache.org> on 2019/12/05 13:10:00 UTC

[jira] [Commented] (TINKERPOP-2318) Edge properties dedup() not work with spark-gremlin

    [ https://issues.apache.org/jira/browse/TINKERPOP-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16988785#comment-16988785 ] 

Jermy Li commented on TINKERPOP-2318:
-------------------------------------

This patch will unify the behavior of property comparison: two properties are equal only if their key&value are equal, even if their parent elements are not equal. It makes sense when comparing properties regardless of parent elements, just focus on the property itself, it would be more uniform and concise.
 The benefit of this change is that the behavior of property comparison and `dedup()`-step are predictable, and it will not affect the result whether a property detaches the parent element.
 Note: The "property" here refer to edge property and meta property, excluding vertex property.

Old behavior:
{code:java}
gremlin> graph = TinkerFactory.createTheCrew()
==>tinkergraph[vertices:6 edges:14]
gremlin> g = graph.traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:14], standard]
gremlin> g.E().properties().count()
==>13
gremlin> g.E().properties()
==>p[since->2009]
==>p[since->2010]
==>p[skill->4]
==>p[skill->5]
==>p[since->2010]
==>p[since->2011]
==>p[skill->5]
==>p[skill->4]
==>p[since->2012]
==>p[skill->3]
==>p[skill->3]
==>p[skill->5]
==>p[skill->3]
gremlin> g.E().properties().dedup().count()
==>13
gremlin> g.E().dedup().properties()
==>p[since->2009]
==>p[since->2010]
==>p[skill->4]
==>p[skill->5]
==>p[since->2010]
==>p[since->2011]
==>p[skill->5]
==>p[skill->4]
==>p[since->2012]
==>p[skill->3]
==>p[skill->3]
==>p[skill->5]
==>p[skill->3]

{code}
 

New behavior:
{code:java}
gremlin> g.E().properties().count()
==>13
gremlin> g.E().properties()
==>p[since->2009]
==>p[since->2010]
==>p[skill->4]
==>p[skill->5]
==>p[since->2010]
==>p[since->2011]
==>p[skill->5]
==>p[skill->4]
==>p[since->2012]
==>p[skill->3]
==>p[skill->3]
==>p[skill->5]
==>p[skill->3]
gremlin> g.E().properties().dedup().count()
==>7
gremlin> g.E().properties().dedup()
==>p[since->2009]
==>p[since->2010]
==>p[skill->4]
==>p[skill->5]
==>p[since->2011]
==>p[since->2012]
==>p[skill->3]

{code}
 

> Edge properties dedup() not work with spark-gremlin
> ---------------------------------------------------
>
>                 Key: TINKERPOP-2318
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2318
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.4.4
>            Reporter: Jermy Li
>            Priority: Critical
>
> Reproduce:
> run Computer test like SparkGraphComputerProcessIntegrateTest, add a test case for the test suit:
> {code:java}
> g.V().bothE().properties().dedup(){code}
>  
> Root cause: two identical DetachedProperty with element=null are not equal.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)