Does anybody know
I am C# developer using the Tinker pop nuget package v3.6.2 .I am struggling with a poblem with regex search. actually everytime I run my code it just goes for ever and nothing returns back until I shutdown the the app. Can anybody help me here:
my code is looks like this
var test1 = g.V().Has("names", TextP.Regex("^Majid*"));
Solution:Jump to solution
Just to summarize here, I think the failure is expected since you are using operators from 3.6.x that Neptune doesn't know how to deal with yet (soon though!). I do find it strange that these traversals dont get an immediate error when it encounters those though. I still would like to know how long you are waiting for the query to return and what exception it is returning with or if it hangs indefinitely (at least past the 2 minute default). I think if it is hanging indefinitely then there might...
16 Replies
How many nodes do you have in the graph? Depending on the DB engine you are using, some text predicates may not be able to use an index-based search, and instead require a full search across the graph. This can be very slow with large graphs.
The query you've written I believe will also attempt to find all matches exhaustively before returning the results. If you supply
.limit(n)
after the .has()
, it will stop once it has found n
matches.I only have 9 nodes with 5 edges
Interesting. This might be related to the C# library or the graph engine then. Which DB are you using? (e.g. Neptune, JanusGraph, etc.)
Neptune
I have tested it with TextP.Containing , ... and it works fine. only Regex has this issue
I just realized the problem is looks like when I use .Next() or .HasNext() or .ToLiist() or etc . So the question is when I ran this query how can I convert the result to array ?
var test1 = g.V().Has("names", TextP.Regex("^Majid")).ToList(); -> this fails
var test1 = g.V().Has("names", TextP.Regex("^Majid")).HasNext(); -> fails
NeptuneAh, Neptune does not yet support TinkerPop 3.6.0, which is crucially when
TextP.regex
was introduced: https://tinkerpop.apache.org/docs/current/reference/#a-note-on-predicatesIn the official javadocs, each method includes a
since
field that indicates when that feature was introduced: https://tinkerpop.apache.org/javadocs/current/core/org/apache/tinkerpop/gremlin/process/traversal/TextP.html#regex(java.lang.String)
Unfortunately I can't see where the current version is mentioned in the Neptune documentation itself, but you can check the version by curl
ing your cluster endpoint or from the Neptune Notebook: https://stackoverflow.com/a/59595714/5100832Stack Overflow
Where can I find out what version of Tinkerpop Gremlin, AWS Neptune...
I am trying to use .valueMap().with(WithOptions.tokens) in my query against AWS Neptune. I get MalformedQueryException. I suspect that this is a new feature in Gremlin 3.4.*
I have not been abl...
Neptune support for 3.6.x is coming soon but...
actually everytime I run my code it just goes for ever and nothing returns back until I shutdown the the appweird that you don't get an error at all on Neptune. i would have guessed you'd get a fairly immediate error.
Thanks for the update @Jesse A hope they start to supporting soon.
Yea actually it is weird, I tried to trap that in "try catch" but looks like it do nothing. as long as it does not any performance impact maybe it is ok but good to notice what is going on to that
Just to be sure: You are actually using terminal steps like
Next()
or ToList()
, right? Because I don't see them in your listing and that would explain why nothing really happensActually yes when I start using these extensions then the application hangs and nothing happening
does it hang longer than the expected timeout?
I haven't set any timeout for the connection but basically it takes very long, I never been that patient to see when/how it ends.
But this only happens for
TextP.Regex()
or for all traversals, including a simple one like g.V([knownVertexId]).Next()
?Neptune has a 2 minute timeout by default, though i'd really expect it to fail immediately. i'd be curious as to what would happen if you waited the full 2 minutes.
It works fine with other operators. even TextP.Containing(), ... are ok but Regex and NotRegex have issue. not sure how does TinkerPop doing this but if .ToList() is applying after Neptune so that is something between Neptune and C# but if it does happening on Neptune side then that should be Neptune issue.
Solution
Just to summarize here, I think the failure is expected since you are using operators from 3.6.x that Neptune doesn't know how to deal with yet (soon though!). I do find it strange that these traversals dont get an immediate error when it encounters those though. I still would like to know how long you are waiting for the query to return and what exception it is returning with or if it hangs indefinitely (at least past the 2 minute default). I think if it is hanging indefinitely then there might be a but we need to look into somewhere.