tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kuppitz (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TINKERPOP-1711) map(union(fold())) bug
Date Mon, 07 Aug 2017 18:55:00 GMT

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

Daniel Kuppitz commented on TINKERPOP-1711:
-------------------------------------------

I feel like I'm running circles debugging this "bug". Meanwhile I believe that this not even
a real bug, but a confusion between local and global scopes. With that said, I think the solution
is the following query:

{noformat}
gremlin> g.V().map(union(values('name'), map(values('lang').fold())).fold())
==>[marko,[]]
==>[vadas,[]]
==>[lop,[java]]
==>[josh,[]]
==>[ripple,[java]]
==>[peter,[]]
{noformat}

...and there's actually nothing wrong with {{union()}} and / or {{fold()}}.

> map(union(fold())) bug
> ----------------------
>
>                 Key: TINKERPOP-1711
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1711
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.2.5
>            Reporter: Robert Dale
>            Assignee: Daniel Kuppitz
>             Fix For: 3.2.6
>
>
> Actual:
> {code:java}
> gremlin> graph = TinkerFactory.createModern()
> ==>tinkergraph[vertices:6 edges:6]
> gremlin> g = graph.traversal()
> ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
> gremlin> g.V().valueMap()
> ==>[name:[marko],age:[29]]
> ==>[name:[vadas],age:[27]]
> ==>[name:[lop],lang:[java]]
> ==>[name:[josh],age:[32]]
> ==>[name:[ripple],lang:[java]]
> ==>[name:[peter],age:[35]]
> gremlin> g.V().map(union(values('name'), values('lang').fold()).fold())
> ==>[marko,[]]
> ==>[[],vadas]
> ==>[lop,[java]]
> ==>[[],josh]
> ==>[ripple,[java]]
> ==>[[],peter]
> {code}
> Expected:
> {code:java}
> gremlin> g.V().map(union(values('name'), values('lang').fold()).fold())
> ==>[marko,[]]
> ==>[vadas,[]]
> ==>[lop,[java]]
> ==>[josh,[]]
> ==>[ripple,[java]]
> ==>[peter,[]]
> {code}
> List reference:  https://groups.google.com/forum/#!topic/gremlin-users/L_fESS6ta0A



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message