I am using Titan 1.0.0 supported by cassandra 2.1.7 as backend storage. While trying to execute the same query on gremlin console and java program, I am getting 2 the output in two different formats. I am using the gremlin console provided by titan-1.0.0-hadoop1 and for java I am using TinkerPop Gremlin 3.0.1-incubating.
Gremlin Console:
gremlin> g.V().has('msid',within(-2128958273, 2147477890)).as('in').local(outE('hie_child').has('hostid_e',within(153,83)).order().by('hrank',incr).limit(5)).group().by(outV().id()).by(inV().id().fold())
==>[77467688:[1531850904, 4742561976, 1009049792, 1010020408, 1053356264], 73363640:[2060075072, 3698942184, 6776295608, 7030726848, 35401920]]
I am getting the expected type of output i.e. Map<VertexId, List<VertexId>>
But while executing the same query in java program, I am getting Map<VertexId, BulkSet>
. The BulkSet
includes a counter indicating the number of times a particular entry is added in the result set. Can someone please tell me if there is a way to get the similar result in java as gremlin console.
Java:
List<Map<Object, Object>> list = g.V().has("msid", P.within(-2128958273,2147477890)).as("in").local(__.outE("hie_child").has("hostid_e", P.within(153,83)).order().by("hrank", Order.incr).limit(5)).group().by(__.outV().id()).by(__.inV().id().fold()).fold().next();
System.out.println(list);
[{77467688={1531850904=1, 4742561976=1, 1009049792=1, 1010020408=1, 1053356264=1}, 73363640={2060075072=1, 3698942184=1, 6776295608=1, 7030726848=1, 35401920=1}}]