Gardanta Spirito
Gardanta Spirito
ATApache TinkerPop
Created by Gardanta Spirito on 4/1/2023 in #questions
Subgraph Strategy with vertexProperties + project().by("field name") = crash
Running the following query: g.withStrategies(new SubgraphStrategy(vertexProperties: constant(true))).V().project("example").by("example") Results in a crash with obscure error:
org.apache.tinkerpop.gremlin.driver.exception.ResponseException: The provided traverser does not map to a value: v[122908680][CacheVertex]->[PropertiesStep([example],property), TraversalFilterStep([ConstantStep(true)]), OrStep([[ClassFilterStep(VertexProperty)], [TraversalFilterStep([ConstantStep(true)])]]), PropertyValueStep][DefaultTraversal] parent[[CoalesceStep([value([PropertiesStep([example],property), TraversalFilterStep([ConstantStep(true)]), OrStep([[ClassFilterStep(VertexProperty)], [TraversalFilterStep([ConstantStep(true)])]]), PropertyValueStep]), (null)])]]
org.apache.tinkerpop.gremlin.driver.exception.ResponseException: The provided traverser does not map to a value: v[122908680][CacheVertex]->[PropertiesStep([example],property), TraversalFilterStep([ConstantStep(true)]), OrStep([[ClassFilterStep(VertexProperty)], [TraversalFilterStep([ConstantStep(true)])]]), PropertyValueStep][DefaultTraversal] parent[[CoalesceStep([value([PropertiesStep([example],property), TraversalFilterStep([ConstantStep(true)]), OrStep([[ClassFilterStep(VertexProperty)], [TraversalFilterStep([ConstantStep(true)])]]), PropertyValueStep]), (null)])]]
At the same time, running it with by(values("example")) finishes just fine. Why?
6 replies
ATApache TinkerPop
Created by Gardanta Spirito on 2/18/2023 in #questions
How to investigate latency
I'm using JanusGraph as my db. When I issue the query via gremlin-console with .profile() step at the end, it finishes execution within 5–8 milliseconds, but when I perform the same request in a parametrized from an application, it takes up 25–40 milliseconds for the database to answer. What takes this time, and how can I minimize it? I have a feeling that most of the time is taken by the backend storage layer (Apache Cassandra), and this time is not shown in the .profile(). Am I correct?
53 replies
ATApache TinkerPop
Created by Gardanta Spirito on 2/13/2023 in #questions
Collect and filter data
I have a complicated query that yields certain vertices, on which I later call .project. It looks somehow like this: complexQuery.project("a", "b", "c", ...).by(queryA).by(queryB).by(queryC).by(...) What I want to do is to later filter the results by some predicates over a, b, c, .... For example, maybe I want to select on those results, where b > 10. And that's when the question arrive: I could add filtering steps after the project, but is this any efficient? I'm just unsure about how gremlin evaluates it: does gremlin at first fully evaluates project and then goes to the following steps, or is the computation of fields a, b, c, ... delayed until they are being filtered on?
3 replies