-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Add primary key with same value not throwing error #2742
Comments
In HugeGraph, when using the memory backend, the default behavior for handling duplicate entries is to merge columns if the entry already exists. This means that if you attempt to insert a vertex with a duplicate primary key, the system will not throw an exception but will instead merge the new entry with the existing one. This is why your test case is passing without an error, and only one vertex is present in the result [1]. Currently, there is no configuration option available to change this default behavior of merging entries in the memory backend [1]. If you require different behavior, such as throwing an exception for duplicate primary keys, you might need to implement custom logic or consider using a different backend that supports such a feature. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
@mkj-git @dosu (All backends have the same logic, not only the In HG's design, the primary key mode does not mean that the key cannot be duplicated. The fundamental reason is that in So by default, the same vid/id will be overwritten instead of reporting an error. If you need a unique constraint, we support a |
Bug Type (问题类型)
None
Before submit
Environment (环境信息)
Expected & Actual behavior (期望与实际表现)
If primary key is about having a unique value then following test case must throw some exception but its passing. Why its silently rejecting second vertex? It should have some config that let schema decide that in case of duplicate should it be ignored or throw exception.
Vertex/Edge example (问题点 / 边数据举例)
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
The text was updated successfully, but these errors were encountered: