This article discusses a situation where a Graph query fails when run on the gremlin console.
Attempts to run a Graph query in the gremlin console returns an error about failure to create an OLAP (analytics) traversal source. For example:
$ dse gremlin-console gremlin> :remote config alias g sixdegrees.g
gremlin> g.V().hasLabel("email").count() Error encountered while constructing Graph/TraversalSource - Unable to create an OLAP Traversal Source \
when Spark is not running or cannot be detected.
In the example above, calling the
count() method makes it an analytics query and requires an OLAP traversal source to be created in order to execute the query in Spark. However, this will only work if the Gremlin console is started on a node running as the Spark master.
Launch the Gremlin console on a node running as the Spark master then run the Graph query. Determine the Spark master using the options below.
OPTION 1 - Run the following command on any node in the cluster:
$ dsetool ring
NOTE - Depending on the version of DSE running, look for the node marked with
OPTION 2 - Run the following command on any node running in Analytics mode:
$ dse client-tool spark master-address