[
https://issues.apache.org/jira/browse/TINKERPOP-2308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stephen Mallette closed TINKERPOP-2308.
---------------------------------------
Resolution: Cannot Reproduce
happy to re-open this one if there are reproduction steps provided as requested
in my last comment. thanks
> IncidentToAdjacentStrategy conflict with RepeatUnrollStrategy when traversal
> has pathStep
> -----------------------------------------------------------------------------------------
>
> Key: TINKERPOP-2308
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2308
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.4.2
> Reporter: Stark Arya
> Priority: Critical
>
> My dsl like:
>
> {code:java}
> g.V("gdb_sample_marko").repeat(__.bothE("gdb_sample_knows",
> "gdb_sample_created",
> "gdb_sample_create").otherV().hasLabel("gdb_sample_person",
> "gdb_sample_software").simplePath()).times(4).hasId("gdb_sample_lop").path().limit(3);{code}
> {code:java}
> // code placeholder
> I call RepeatUnrollStrategy, then EarlyLimitStrategy to optimize the
> traversal:
> protected Traversal.Admin<?, ?> applyStrategy(GraphTraversal<?, ?>
> traversal) {
> TraversalStrategies s = new DefaultTraversalStrategies();
> s.addStrategies(RepeatUnrollStrategy.instance(),
> EarlyLimitStrategy.instance());
> s.toList().forEach(traversalStrategy -> {
> System.out.println("before " + traversalStrategy.toString() + "
> traversal - " + traversal);
> traversalStrategy.apply(traversal.asAdmin());
> });
> //s.applyStrategies(traversal.asAdmin());
> return traversal.asAdmin();
> }
> {code}
> And after RepeatUnrollStrategy finished, the traversal became:
> {code:java}
> before EarlyLimitStrategy traversal - [GraphStep(vertex,[gdb_sample_marko]),
> VertexStep(BOTH,[gdb_sample_knows, gdb_sample_created,
> gdb_sample_create],vertex), HasStep([~label.within([gdb_sample_person,
> gdb_sample_software])]), PathFilterStep(simple), NoOpBarrierStep(2500),
> VertexStep(BOTH,[gdb_sample_knows, gdb_sample_created,
> gdb_sample_create],vertex), HasStep([~label.within([gdb_sample_person,
> gdb_sample_software])]), PathFilterStep(simple), NoOpBarrierStep(2500),
> VertexStep(BOTH,[gdb_sample_knows, gdb_sample_created,
> gdb_sample_create],vertex), HasStep([~label.within([gdb_sample_person,
> gdb_sample_software])]), PathFilterStep(simple), NoOpBarrierStep(2500),
> VertexStep(BOTH,[gdb_sample_knows, gdb_sample_created,
> gdb_sample_create],vertex), HasStep([~label.within([gdb_sample_person,
> gdb_sample_software])]), PathFilterStep(simple), NoOpBarrierStep(2500),
> HasStep([~id.eq(gdb_sample_lop)]), PathStep, RangeGlobalStep(0,3)]
> before Gr{code}
> At this points , Bug occured: VertexStep and EdgeOtherVertexStep merge into
> VertexStep。 so the path result will lost edge info。
>
> Why ?
> {code:java}
> RepeatUnrollStrategy.apply has this line:
> TraversalHelper.applySingleLevelStrategies(traversal, repeatTraversal,
> RepeatUnrollStrategy.class);
> the code will use traversal.asAdmin().getStrategies() to optimize the
> following repeatTraversal:
> [VertexStep(BOTH,[gdb_sample_knows,
> gdb_sample_created,gdb_sample_create],edge),
> EdgeOtherVertexStep,
> HasStep([~label.within([gdb_sample_person, gdb_sample_software])]),
> PathFilterStep(simple),
> RepeatEndStep]
> And traversal.asAdmin().getStrategies() list may be:
> [ConnectiveStrategy, IncidentToAdjacentStrategy, EarlyLimitStrategy,
> MatchPredicateStrategy, FilterRankingStrategy, InlineFilterStrategy,
> AdjacentToIncidentStrategy, RepeatUnrollStrategy, CountStrategy,
> PathRetractionStrategy, LazyBarrierStrategy]
> So IncidentToAdjacentStrategy will be appled before RepeatUnrollStrategy.
> so the error occured.
> {code}
> How to fix?
> IncidentToAdjacentStrategy.apply add following slice and result just ok
> {code:java}
> @Override
> 123 public void apply(final Traversal.Admin<?, ?> traversal) {
> 124
> 125 if ( (!(traversal.getParent() instanceof EmptyStep)) &&
> TraversalHelper.hasStepOfAssignableClassRecursively(INVALIDATING_ST
> EP_CLASSES, traversal.getParent().asStep().getTraversal())){
> 126 return;
> 127 }
> 128... origin logic code{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)