[ 
https://issues.apache.org/jira/browse/TINKERPOP-2828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17637664#comment-17637664
 ] 

Florian Hockmann commented on TINKERPOP-2828:
---------------------------------------------

{quote}Do you think it would be better to not throw an error and rather return 
nil in case of Janus?
{quote}
I think it's the right thing to do for Gremlin-Go to throw an error if it 
encounters a type during deserialization for which it has no deserializer 
configured. That way, you as the user notice that something is not working like 
you expected and you can now decide how to deal with it. If it would simply 
return {{nil}} instead, then you wouldn't know whether the value is simply 
missing or whether it couldn't be deserialized by the driver.

Now, you can handle it either by implementing a deserializer for that type on 
your own (which you could make available for other JanusGraph users to use) or 
by working around this limitation, meaning that your traversals should not 
return a {{RelationIdentifier}} any more.

If you're interested in writing your own serializer / deserializer, then taking 
a look at the current Gremlin-Go serializers is probably a good idea: 
[https://github.com/apache/tinkerpop/blob/master/gremlin-go/driver/graphBinary.go]

and for the JanusGraph {{{}RelationIdentifier{}}}, you can for example check 
out the .NET implementation: 
[https://github.com/JanusGraph/janusgraph-dotnet/blob/master/src/JanusGraph.Net/IO/GraphBinary/Types/RelationIdentifierSerializer.cs]
{quote}Is it possible to somehow detect the type and transparently use the 
correct deserializer?
{quote}
The problem is that Gremlin-Go simply has no serializer for the JanusGraph type 
{{{}RelationIdentifier{}}}. If it would have one, then it could of course also 
select it.

> Golang driver cannot deserialize edge id
> ----------------------------------------
>
>                 Key: TINKERPOP-2828
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2828
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: go
>    Affects Versions: 3.6.1, 3.5.4
>            Reporter: Navgeet
>            Priority: Major
>              Labels: golang
>         Attachments: main.go
>
>
> The issue occurs when we call {{ElementMap}} for edges. On further debugging, 
> I found {{label}} can be deserialized but not {{{}id{}}}.
>  
> {noformat}
> Error occurred during operation gremlinServerWSProtocol.readLoop(): 'E0408: 
> unknown data type to deserialize 0x0'
> Read loop error 'E0408: unknown data type to deserialize 0x0', closing read 
> loop.
> Connection error callback invoked, closing protocol.
> E0408: unknown data type to deserialize 0x0
> {noformat}
> Please see attached code for reproducing the issue.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to