Gremlin query from Java returns null when a non-vertex\edge collection returned

37 views
Skip to first unread message

Natal Kaplya

unread,
Mar 28, 2015, 7:18:54 PM3/28/15
to orient-...@googlegroups.com
OrientDB 2.0.5
Blueprints 2.6.0

I am quering remote db via gremlin from Java like this:

OrientBaseGraph graph = OrientGraphFactory.getNoTx(); \\a bit of pseudocode in this line
OGremlinHelper.global().setMaxGraphPool(100).create();

String query = "g.E().groupBy{it.weight}{it}.cap.next()";
OCommandGremlin cmd = new OCommandGremlin(query);
Object tt = graph.command(cmd).execute();

Everything is ok and result is correct when query doesn't contain groupBy clause. 
I suppose that the problem is in returning a collection of elements except Vertices or Edges, because the returned Iterable has right number of elements, corresponding to the groups count or another non-Vertex\edge elements. But all the elements are nulls.
E.g. this works:
g.E.filter{ it.weight != 3}.weight[4]

and this does not:
g.E.filter{ it.weight != 3}.weight[1..4]

but the size of returned Iterable is 4, full of nulls. In case of groupBy query it's the same: 
Iterable's size corresponds to real groups count, but contains nulls. So, it probably is correctly fetched, but incorrectly returned(serialized or something).


This functionality is very important for me for the following reason. I know about Rexster and everything works ok with it, except performance in comparison with builtin gremlin OrientDB support, I mean that, which works in studio. It's 5 times longer query fetching time when I use Rexster or Java Gremlin Groovy because of I\O overhead, that is very large(I profiled, it's all the I\O that make 5x performance drop). And this is the only way I found to execute Gremlin queries in server-side. If there are another ways of server-side gremlin queries fetching, it would be greatly appreciated. 

Probably I should create an issue if the bug is confirmed here. 

Hope for your help,
Natal Kaplya
Reply all
Reply to author
Forward
0 new messages