GeezerVison is showing github.com — Issue 155: Updated JanusGraphStepStrategy to fold hasId steps into JanusGraphStep by twilmes · Pull Request #159 · JanusGraph/janusgraph
Conversation
This PR updates the JanusGraphStepStrategy to fold hasId steps into JanusGraphStep. This was causing issues with bulk loading via the BulkLoaderVertexProgram. HasIdStep was not folded in so full graph scans were being triggered on id lookups. This did not effect traversals of the form g.V(id), just g.V().hasId(id).
I made a few other small updates as part of this. First, it appeared that JanusGraphStepStrategyTest had some spurious annotations on it that were causing it to not run. I removed those so it will be run now and added in a test case for hasId folding. I also removed unnecessary publics from the HasStepFolder interface.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Pushed another commit that refactors the JanusGraphStepStrategyTest to the TinkerPop strategy testing style which I think is easier to follow and provides better coverage.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
pluradj
commented
Mar 14, 2017
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
This query throws an exception:
gremlin> g.V().has("name", "marko").or().has("name", "vadas")
JanusGraph does not support the given predicate: org.apache.tinkerpop.gremlin.process.traversal.util.OrP$OrBiPredicate@5349b246
Type ':help' or ':h' for help.
Display stack trace? [yN]y
java.lang.IllegalArgumentException: JanusGraph does not support the given predicate: org.apache.tinkerpop.gremlin.process.traversal.util.OrP$OrBiPredicate@5349b246
at org.janusgraph.graphdb.query.JanusGraphPredicate$Converter.convert(JanusGraphPredicate.java:116)
at org.janusgraph.graphdb.tinkerpop.optimize.JanusGraphStep.lambda$new$49(JanusGraphStep.java:64)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep.processNextStart(GraphStep.java:136)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:179)
at org.apache.tinkerpop.gremlin.console.Console$_closure3.doCall(Console.groovy:220)
Traversal strategy seems ok
Original Traversal [GraphStep(vertex,[]), HasStep([name.eq(marko)]), OrStep, HasStep([name.eq(vadas)])]
ConnectiveStrategy [D] [GraphStep(vertex,[]), OrStep([[HasStep([name.eq(vadas)])], [HasStep([name.eq(marko)])]])]
IncidentToAdjacentStrategy [O] [GraphStep(vertex,[]), OrStep([[HasStep([name.eq(vadas)])], [HasStep([name.eq(marko)])]])]
InlineFilterStrategy [O] [GraphStep(vertex,[]), HasStep([name.or(eq(vadas), eq(marko))])]
MatchPredicateStrategy [O] [GraphStep(vertex,[]), HasStep([name.or(eq(vadas), eq(marko))])]
RepeatUnrollStrategy [O] [GraphStep(vertex,[]), HasStep([name.or(eq(vadas), eq(marko))])]
PathRetractionStrategy [O] [GraphStep(vertex,[]), HasStep([name.or(eq(vadas), eq(marko))])]
AdjacentToIncidentStrategy [O] [GraphStep(vertex,[]), HasStep([name.or(eq(vadas), eq(marko))])]
RangeByIsCountStrategy [O] [GraphStep(vertex,[]), HasStep([name.or(eq(vadas), eq(marko))])]
FilterRankingStrategy [O] [GraphStep(vertex,[]), HasStep([name.or(eq(vadas), eq(marko))])]
LazyBarrierStrategy [O] [GraphStep(vertex,[]), HasStep([name.or(eq(vadas), eq(marko))])]
AdjacentVertexFilterOptimizerStrategy [P] [GraphStep(vertex,[]), HasStep([name.or(eq(vadas), eq(marko))])]
JanusGraphLocalQueryOptimizerStrategy [P] [GraphStep(vertex,[]), HasStep([name.or(eq(vadas), eq(marko))])]
JanusGraphStepStrategy [P] [JanusGraphStep([],[name.or(eq(vadas), eq(marko))])]
ProfileStrategy [F] [JanusGraphStep([],[name.or(eq(vadas), eq(marko))])]
StandardVerificationStrategy [V] [JanusGraphStep([],[name.or(eq(vadas), eq(marko))])]
Final Traversal [JanusGraphStep([],[name.or(eq(vadas), eq(marko))])]
The same query works on TinkerGraph with TP 3.2.3, and on JanusGraph (with the WARN) before applying this PR.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Good catch, I was folding in HasContainers too aggressively. Found this other issue though which looks like it's occurring straight off of master. I'll see if I can fix as part of this ticket.
gremlin> g.V().has("name","marko").or().has("name","vadas")
11:40:35 WARN org.janusgraph.graphdb.transaction.StandardJanusGraphTx - Query requires iterating over all vertices [()]. For better performance, use indexes
==>v[4160]
==>v[4200]
gremlin> g.V().has("name","marko").or().has("name","vadas").count()
11:40:38 WARN org.janusgraph.graphdb.transaction.StandardJanusGraphTx - Query requires iterating over all vertices [()]. For better performance, use indexes
==>v[4160]
==>v[8296]
==>v[4272]
==>v[4264]
==>v[4200]
==>v[4280]
gremlin>
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Committer of one or more commits is not listed as a CLA signer, either individual or as a member of an organization.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
* hasId folded into JanusGraphStep to prevent full scan
* Refactored JanusGraphStepStrategyTest to use TinkerPop strategy testing approach
|
Pushed a fix so that foldId only folds id lookups and foldHasContainers handles other predicates. That previous issue I noted is actually expected behavior given that the query uses the infix notation of the 'OrStep' so no changes were required. I did find cases where further predicate folding should occur but entered that as issue #163.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening up the other issue.
The latest push looks good to me.
VOTE: +1
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, i like the incremental improvement on existing code you do as well.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
sjudeng
commented
Apr 2, 2017
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
@twilmes Sorry I know this PR is merged but could you explain a little on the refactoring of JanusGraphStepStrategyTest you did here?
Before this update JanusGraphStepStrategyTest was run with ProcessStandardSuite and resulted in 605 tests being run. With this update the class is no longer run with ProcessStandardSuite and so only the 15 tests in the class are run.
I'm interested because one of the issues in updating to TinkerPop 3.2.4 had been test errors/failures in ProfileTest when run through JanusGraphStepStrategyTest. Now that's no longer run so the error is gone. On the one hand I'm happy the error is gone but on the other hand I feel compelled to double check that something isn't being hidden here. For what it's worth ProfileTest is already run (I think without error) in numerous other tests suites, including InMemoryJanusGraphProcessTest, BerkeleyJanusGraphProcessTest, etc..
Update: I am having ProfileTest issues with 3.2.4 elsewhere so this question is moot on that basis. Still curious to make sure nothing was lost in JanusGraphStepStrategyTest though.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hi is there any work happening regarding a Web interface for JanusGraph
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
bwatson-rti-org
pushed a commit
to bwatson-rti-org/janusgraph
that referenced
this pull request
Mar 9, 2019
Issue 155: Updated JanusGraphStepStrategy to fold hasId steps into JanusGraphStep
micpod
pushed a commit
to micpod/janusgraph
that referenced
this pull request
Nov 5, 2019
Issue 155: Updated JanusGraphStepStrategy to fold hasId steps into JanusGraphStep
Reviewers
amcp
amcp approved these changes
pluradj
pluradj approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
cla: yes
This PR is compliant with the CLA
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|