GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JSON Importer does not use the merge strategy · Issue #1492 · ArcadeData/arcadedb

JSON Importer does not use the merge strategy #1492

New issue
Copy link
New issue
Copy link
Closed
Closed
JSON Importer does not use the merge strategy#1492
Copy link
Assignees
lvca
Milestone
24.2.1

Description

@lvca
lvca
opened on Mar 1, 2024
Issue body actions

The JSON importer doesn't merge the records in case they already exist.

To reproduce execute:

import database emp.json with mapping = {
    "Users": [{
        "@cat": "v",
        "@type": "User",
        "@id": "id",
        "@idType": "string",
        "@strategy": "merge",
        "EmployeeID": "@ignore",
        "ManagerID":  {
            "@cat": "e",
            "@type": "HAS_MANAGER",
            "@in": {
                "@cat": "v",
                "@type": "User",
                "@id": "id",
                "@idType": "string",
                "@strategy": "merge",
                "EmployeeID": "@ignore",
                "id": "<../ManagerID>"
            }
        }
    }]
}

Error:

Caused by: com.arcadedb.exception.DuplicatedKeyException: Duplicated key [1234] found on index 'User[id]' already assigned to record #7:0

        at com.arcadedb.database.TransactionIndexContext.checkUniqueIndexKeys(TransactionIndexContext.java:344)

        at com.arcadedb.database.TransactionIndexContext.checkUniqueIndexKeys(TransactionIndexContext.java:379)

        at com.arcadedb.database.TransactionIndexContext.commit(TransactionIndexContext.java:161)

        at com.arcadedb.database.TransactionContext.commit1stPhase(TransactionContext.java:569)

        at com.arcadedb.database.TransactionContext.commit(TransactionContext.java:121)

        at com.arcadedb.database.LocalDatabase.lambda$commit$2(LocalDatabase.java:397)

        at com.arcadedb.database.LocalDatabase.executeInReadLock(LocalDatabase.java:1415)

        at com.arcadedb.database.LocalDatabase.commit(LocalDatabase.java:392)

        at com.arcadedb.integration.importer.format.JSONImporterFormat.parseRecords(JSONImporterFormat.java:142)

        at com.arcadedb.integration.importer.format.JSONImporterFormat.load(JSONImporterFormat.java:95)

        at com.arcadedb.integration.importer.Importer.loadFromSource(Importer.java:107)

        at com.arcadedb.integration.importer.Importer.load(Importer.java:54)

Dataset:

{
  "Users":[
    {
      "id": "1",
      "EmployeeID":"1234",
      "Name":"Marcus"
    },
    {
      "id": "2",
      "EmployeeID":"1230",
      "ManagerID":"1234",
      "Name":"Win"
    },
    {
      "id": "3",
      "EmployeeID":"1232",
      "ManagerID":"1234",
      "Name":"Dave"
    }
  ]
} 

Activity

  1. lvca
    self-assigned this
    on Mar 1, 2024
  2. lvca
    added
    bug
    in progressThe team is actively working on this issue
    on Mar 1, 2024
  3. lvca
    added a commit that references this issue on Mar 1, 2024

    fix: json importer did not use merge strategy correctly

    5ecb28e
  4. lvca
    added this to the 24.2.1 milestone on Mar 1, 2024
  5. lvca
    closed this as completedon Mar 1, 2024
  6. lvca
    added
    fixed
    and removed
    in progressThe team is actively working on this issue
    on Mar 12, 2024
  7. tae898
    added a commit that references this issue on Jun 28, 2026

    fix: json importer did not use merge strategy correctly

    9b117d2
  8. mergify
    added a commit that references this issue on Jul 19, 2026

    chore(deps): bump the github-actions group with 5 updates [skip ci]

    3ca18b5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lvca
    lvca

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    • 24.2.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.