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

ASF GitHub Bot commented on TINKERPOP3-779:
-------------------------------------------

GitHub user mhfrantz opened a pull request:

    https://github.com/apache/incubator-tinkerpop/pull/91

    TINKERPOP3-779: RFC for coalesce retain path

    I tried to make some progress on this.  First, I added unit test to 
reproduce the bug.
    
    I then changed the child traversals from local to global, based on the fact 
that BranchStep shows its branch traversals as global.  I'm not entirely sure 
what this does, and it had no effect on the test.
    
    Next, I tried to reimplement CoalesceStep using ComputerAwareStep (instead 
of FlatMapStep).  This seems necessary, since the child traversals can do 
whatever they want.  My test now passes in "standard" mode, but fails in 
"computer" mode.
    
    In "computer" mode, I'm not sure how to implement the sequential "first 
successful child" logic.  What's in there now is "follow all paths" logic.  If 
it appears that I am on the right track, I can work more on this.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/RedSeal-co/incubator-tinkerpop 
TINKERPOP3-779-coalesce-retain-path

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-tinkerpop/pull/91.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 #91
    
----
commit a1c177983a36932c3a9d92f8fbf83e49431ed612
Author: mhfrantz <[email protected]>
Date:   2015-07-22T16:30:08Z

    TINKERPOP3-779: Add repro (test that shows coalesce needs to retain path)

commit 848008252300881591c17fe204ecfd72902390e5
Author: mhfrantz <[email protected]>
Date:   2015-07-22T16:31:50Z

    TINKERPOP3-779: Make coalesce children global instead of local

commit b3fcd6123ea3f1723b899737e8baf86ad334cb97
Author: mhfrantz <[email protected]>
Date:   2015-07-22T16:32:25Z

    TINKERPOP3-779: CoalesceStep is a ComputerAwareStep instead of a FlatMapStep

----


> coalesce should not forget path
> -------------------------------
>
>                 Key: TINKERPOP3-779
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-779
>             Project: TinkerPop 3
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.0.0-incubating
>            Reporter: Matt Frantz
>            Assignee: Matt Frantz
>
> It seems like the path along whichever branch of the {{coalesce}} step should 
> be preserved downstream.  In 3.0.0, this is not the case:
> {noformat}
> gremlin> g.V().out().out().path()
> ==>[v[1], v[4], v[5]]
> ==>[v[1], v[4], v[3]]
> gremlin> g.V().coalesce(out().out()).path()
> ==>[v[1], v[5]]
> ==>[v[1], v[3]]
> {noformat}
> I would expect the output of the second statement to equal the first.
> Also, to be clear, the path should reflect whichever of the traversal 
> arguments to {{coalesce}} were productive.
> {noformat}
> gremlin> g.V().out().out().path()
> ==>[v[1], v[4], v[5]]
> ==>[v[1], v[4], v[3]]
> gremlin> g.V().coalesce(out().out().out(), out().out()).path()
> ==>[v[1], v[5]]
> ==>[v[1], v[3]]
> {noformat}
> Again, I would expect the output of the second statement to equal the first.
> The path truncation behavior would be nice to preserve in the proposed 
> {{sub}} step (TINKERPOP3-716).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to