GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Issue 155: Updated JanusGraphStepStrategy to fold hasId steps into JanusGraphStep by twilmes · Pull Request #159 · JanusGraph/janusgraph

Conversation

@twilmes

@twilmes twilmes commented Mar 8, 2017

Copy link
Copy Markdown
Contributor

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.

All reactions
@twilmes
twilmes requested a review from pluradj March 8, 2017 17:36
@janusgraph-bot janusgraph-bot added the cla: yes This PR is compliant with the CLA label Mar 8, 2017
@twilmes twilmes mentioned this pull request Mar 8, 2017
"Query requires iterating over all vertices" warning when using g.V().hasId(x) #155
Closed
@twilmes

twilmes commented Mar 9, 2017

Copy link
Copy Markdown
Contributor Author

Pushed another commit that refactors the JanusGraphStepStrategyTest to the TinkerPop strategy testing style which I think is easier to follow and provides better coverage.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pluradj

pluradj commented Mar 14, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jerryjch jerryjch mentioned this pull request Mar 14, 2017
Add PR template #146
Merged
@twilmes

twilmes commented Mar 14, 2017

Copy link
Copy Markdown
Contributor Author

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>
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@twilmes
twilmes force-pushed the issue_155_hasId branch from 5b8edc0 to 8b6bd6e Compare March 15, 2017 01:19
@janusgraph-bot

janusgraph-bot commented Mar 15, 2017

Copy link
Copy Markdown

Committer of one or more commits is not listed as a CLA signer, either individual or as a member of an organization.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@janusgraph-bot janusgraph-bot added cla: no This PR is not compliant with the CLA and removed cla: yes This PR is compliant with the CLA labels Mar 15, 2017
@twilmes
Updates to JanusGraphStepStrategy
49e3bde
* hasId folded into JanusGraphStep to prevent full scan
* Refactored JanusGraphStepStrategyTest to use TinkerPop strategy testing approach
@twilmes
twilmes force-pushed the issue_155_hasId branch from 8b6bd6e to 49e3bde Compare March 15, 2017 01:22
@janusgraph-bot janusgraph-bot added cla: yes This PR is compliant with the CLA and removed cla: no This PR is not compliant with the CLA labels Mar 15, 2017
@twilmes

twilmes commented Mar 15, 2017

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pluradj
pluradj approved these changes Mar 17, 2017
View reviewed changes

@pluradj pluradj left a comment

Copy link
Copy Markdown
Member

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.

All reactions
amcp
amcp approved these changes Mar 18, 2017
View reviewed changes

@amcp amcp left a comment

Copy link
Copy Markdown

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.

All reactions
@twilmes
twilmes merged commit 15896b7 into JanusGraph:master Mar 18, 2017
@sjudeng

sjudeng commented Apr 2, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@NkululekoThangelane

NkululekoThangelane commented Apr 2, 2017

Copy link
Copy Markdown

Hi is there any work happening regarding a Web interface for JanusGraph

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sjudeng

sjudeng commented Apr 2, 2017

Copy link
Copy Markdown
Contributor

@NkululekoThangelane Gremlin Server provides a web service for executing queries. But if you can post your question on the user list or chat room you might get more information on this (or other options).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@robertdale robertdale mentioned this pull request Nov 19, 2017
hasId short-circuits following steps #723
Closed
bwatson-rti-org pushed a commit to bwatson-rti-org/janusgraph that referenced this pull request Mar 9, 2019
@twilmes
Merge pull request JanusGraph#159 from twilmes/issue_155_hasId
a4d26ec
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
@twilmes
Merge pull request JanusGraph#159 from twilmes/issue_155_hasId
68c330a
Issue 155: Updated JanusGraphStepStrategy to fold hasId steps into JanusGraphStep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@amcp amcp amcp approved these changes
@pluradj 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

Projects

None yet

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.

6 participants

@twilmes @pluradj @janusgraph-bot @sjudeng @NkululekoThangelane @amcp
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.