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

Skip to first unread message

Natal Kaplya

Mar 28, 2015, 7:18:54 PM3/28/15
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;

String query = "g.E().groupBy{it.weight}{it}";
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
0 new messages