[Feature][Connector-V2] Support sink connector for Apache HugeGraph#10002
Conversation
…into hg-connector
* docs: init SeaTunnel-HG design doc V1 🚧 (#4) * docs: init hugegraph design doc V1 🚧 * update development docs --------- Co-authored-by: Frui Guo <guofreedomly@gmail.com> * update docs --------- Co-authored-by: imbajin <jin@apache.org>
Replaced GremlinManager-based graph operations with HugeClient REST API methods for vertex management and verification. Updated schema setup and test logic to improve reliability and remove direct Gremlin queries.
Configured maven-jar-plugin to include Implementation-Version in the jar manifest using hugegraph.client.version. Refactored HugeGraphSinkWriterIT to improve import ordering and line wrapping for better readability.
|
good job |
|
|
||
| class HugeGraphSinkConfigTest { | ||
| // 使用 @Mock 注解自动创建 mock 对象 | ||
| @Mock private ReadonlyConfig mockConfig; |
There was a problem hiding this comment.
Please keep the source code in English
There was a problem hiding this comment.
Thanks. I've addressed all the comments regarding the documentation/notes.
| assertEquals(1, hugeClient.graph().listEdges("knows").size()); | ||
|
|
There was a problem hiding this comment.
I'm not familiar with graphs. Shouldn't this be 2 when knows adds two edges?
There was a problem hiding this comment.
Apologies for the confusion. This is the expected "edge override" behavior.
To confirm, when an EdgeLabel's frequency is single, attempting to create a second edge with the same source, target, and EdgeLabel will overwrite the existing one.
I have refined the test for this specific scenario and moved it to testEdgeInsert.
|
Good job, things are getting better |
| @@ -0,0 +1,357 @@ | |||
| # SeaTunnel Connector 架构设计分析 | |||
There was a problem hiding this comment.
This document is not needed
corgy-w
left a comment
There was a problem hiding this comment.
Could you provide a screenshot of the successful run on your local device
I have updated the PR with the requested changes. Additionally, I've attached a screenshot verifying that the local database synchronization is successful. Please take a look. |
corgy-w
left a comment
There was a problem hiding this comment.
Are upsert operations supported now? Does writing graph data need to support upsert?
The hugegraph-client natively supports upsert operations. For update operations, you can use the update method to update the properties of vertices and edges, excluding the primary key (note that for edges, the values of SortedKeys-related properties constitute the primary key). |
get |
Purpose of this pull request
fix #10001
Does this PR introduce any user-facing change?
This PR introduces a new Sink V2 connector:
connector-hugegraph.This allows users to configure a job to sink data into a HugeGraph database. Users can now write
SeaTunnelRowdata as either Vertices or Edges, specifying mappings for labels, ID strategy, and properties.How was this patch tested?
Both Unit Tests (UT) and End-to-End (E2E) Tests were added for this new connector.
Unit Tests:
Added unit tests for HugeGraphSinkConfig to verify the parsing and validation of required sink-side options (e.g., checking necessary fields like url and graph_name).
E2E Tests:
Added a new E2E test module connector-hugegraph-e2e under the seatunnel-e2e/seatunnel-connector-v2-e2t/ directory.
This test uses a Docker container to spin up a temporary HugeGraph service instance.
It runs multiple test cases based on configuration files: testing writing SeaTunnelRow data as vertices, and testing writing SeaTunnelRow data as edges.
This is an example config for vertex synchronization:
Test Sceenshots:


Use fake source to simulate source database, the detailed configuration is in the documentation.
The following are the query results before and after the sync.
I attempted to sync data from MySQL using stream processing, but I could only synchronize a part of it, likely because I don't have a Hadoop environment.
Check list
New License Guide