Could lamba statements turn into Tinkerpop ByteCode?

53 views
Skip to first unread message

Yuxing Han

unread,
Dec 30, 2019, 1:55:24 AM12/30/19
to Gremlin-users
I am asking this question just for sure. According to my experience, the answer is no.
Take the following gremlin statements for example:

ResultSet results = client.alias("g").submit(g.V().filter(it -> it.get().value("name") == "marko")); 
for (Result result: results) { 
System.out.println(result.getString());
 }

This code example will cause errors like:
...
...
Caused by: 
org.apache.tinkerpop.gremlin.driver.exception.ResponseException: An error occurred during serialization of this request [RequestMessage{, requestId=268d5630-0c4c-4293-bf39-2aea9136f036, op='bytecode', processor='traversal', args={gremlin=[[], [V(), filter(TinkerpopTest$$Lambda$31/1856158867@35a7023b)]], aliases={g=g}}}] - it could not be sent to the server - Reason: org.apache.tinkerpop.gremlin.driver.ser.SerializationException: java.lang.IllegalArgumentException: Class is not registered: TinkerpopTest$$Lambda$31/1856158867

Stephen Mallette

unread,
Dec 30, 2019, 11:21:06 AM12/30/19
to gremli...@googlegroups.com
You can use lambdas with bytecode assuming the server supports it, however the lambda itself must be submitted as strings:


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/86da22d5-ba21-4443-a088-6b8a56b074ef%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages