-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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]: Found duplicated primary key value Runtime::runtimecall, which violates the uniqueness constraint of the primary key column. #13462
Comments
The error you're encountering is due to a duplicated primary key value
Here's a code snippet to help with implementing a uniqueness check: def insert_unique_document(self, document: Document, **insert_kwargs: Any) -> None:
"""Insert a document only if it's unique based on its primary key."""
existing_doc_hash = self._docstore.get_document_hash(document.get_doc_id())
if existing_doc_hash is None:
# Document is unique, proceed with insertion
self.insert(document, **insert_kwargs)
else:
# Document already exists, handle accordingly
logger.warning(f"Document with ID {document.get_doc_id()} already exists.") Integrate this uniqueness check into your workflow where documents or nodes are inserted into the index. Adjust the logic according to your specific requirements, such as updating existing documents instead of skipping them. This approach should help you avoid the duplication error and ensure the uniqueness constraint of the primary key column is not violated during the indexing process.
|
None of the above solution helps to solve this problem. |
If none of the previously suggested solutions have resolved the issue with the duplicated primary key value
Given the complexity of the issue and the potential for it to be rooted in the specific implementation details of your Knowledge Graph Index or the underlying data, these steps are aimed at guiding you towards identifying and resolving the root cause of the duplication error.
|
Bug Description
When i am trying to create a KG using Kuzu and running following code.
I get this error about duplicate primary key. Which I understand that in KG all the primary keys needs to be unique but I don't see a place to fix this.
Version
llama-index 0.10.36
Steps to Reproduce
Running GH repo reader
Running indexer
Relevant Logs/Tracbacks
The text was updated successfully, but these errors were encountered: