Gremlin-Go: tree steps not serializable
Feb 09, 2024 am 10:51 AMphp editor Apple Gremlin-Go is a new type of distributed database. It uses the technology of non-serializable tree steps to provide users with more efficient and reliable data. Storage and handling options. By storing data in a tree structure and using non-serializable steps to read and write data, Gremlin-Go is able to maintain data consistency and reliability in a distributed environment. This innovative design concept makes Gremlin-Go one of the leading distributed databases currently, providing powerful data support for enterprises of all sizes.
Question content
I am running a query to iterate through all "in" edges behind a specific label, later I will perform a similar query for the "out" edges. I want to make this a tree as there may be a vertex with multiple edges to traverse and need to reflect this in my client so I can't just use tolist()
here .
I'm currently using the gremlin-go sdk, but I'm getting a deserialization error when calling the tree()
step. Here is a snippet of my client code:
res, err := g.v(id). emit(). repeat(__.in(label)). tree(). next() // other terminal steps produce same issue
This will generate a deserialization error on data type 0x2b
which is the graphbinary core data type "tree"
2023/02/28 12:23:05 Error occurred during operation gremlinServerWSProtocol.readLoop(): 'E0408: unknown data type to deserialize 0x2b' 2023/02/28 12:23:05 Read loop error 'E0408: unknown data type to deserialize 0x2b', closing read loop. 2023/02/28 12:23:05 Connection error callback invoked, closing protocol.
The gremlin-go reference documentation doesn't seem to mention anything about specific serialization support. According to the gremlin-go
readme, it supports all core graphbinary data types. I've tested my query in gremlin console to verify query and server:
g.v(<id>).emit().repeat(__.in(<label>)).tree().next()</label></id>
.
For some additional context, I'm developing locally against gremlin-server:3.5.3
to experiment with the goal of completing queries with support for aws neptune. I know these are not completely interchangeable and will follow the neptune-gremlin reference. The latest version of neptune specifies that the latest supported version of gremlin is 3.5.3.
Workaround
In general, only Java (and other JVM-based clients) can deserialize structures like subgraphs or trees. This is because these are the only Gremlin clients that have native implementations of currently available data structures (e.g. JVM clients have TinkerGraph available).
This is one the TinkerPop community knows very well, and it's on the list of things worth improving.
One possible workaround (not very nice) is to use an HTTP endpoint (send the query as text) and process the returned GraphSON (if such a data structure must be returned).
The above is the detailed content of Gremlin-Go: tree steps not serializable. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Go language pack import: What is the difference between underscore and without underscore?

How to implement short-term information transfer between pages in the Beego framework?

How do I write mock objects and stubs for testing in Go?

How can I use tracing tools to understand the execution flow of my Go applications?

How to convert MySQL query result List into a custom structure slice in Go language?

How can I define custom type constraints for generics in Go?

How to write files in Go language conveniently?

How can I use linters and static analysis tools to improve the quality and maintainability of my Go code?
