Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Gremlin bulk insert doesn't insert edge documents #69

Open
nelsonwellswku opened this issue Apr 1, 2020 · 4 comments
Open

Gremlin bulk insert doesn't insert edge documents #69

nelsonwellswku opened this issue Apr 1, 2020 · 4 comments

Comments

@nelsonwellswku
Copy link

nelsonwellswku commented Apr 1, 2020

I got the link to this Github through this Nuget page, so if this is the wrong tracker, please redirect me.

When using the GraphBulkExecutor, I am able to load vertices, but not edges. There is no error message when loading the edges, they simply do not show up in the graph. I am using version 2.4.1-preview of the Nuget package. I am using 2.9.2.0 of the Azure Cosmos DB emulator. I have also tried against an actual Cosmos DB graph database as of the date of this post (4/1/2020).

Here is a link to a sample application that I think demonstrates the problem adequately. It could be that I am creating the edges incorrectly, but if so I do not see the problem and, as I said before, the library gives me no indication of failure. In fact, if you review the logs that I've sprinkled throughout the application, it tells me specifically that there were no bad input documents during the edge bulk insert.

If there's any additional information I can provide, please let me know.

@nelsonwellswku
Copy link
Author

I looked into this further by using CosmosDB's SQL query functionality and I found something. The document structure of the edge has this shape:

{
    "id": "actorId001283_movieId4941828",
    "label": "ActedIn",
    "_sink": "movieId4941828",
    "_vertexId": "actorId001283",
    "_sinkLabel": "HadActor",
    "_vertexLabel": "ActedIn",
    "_isEdge": true,
    "PartitionKey": "actorId001283_movieId4941828_out",
    "_sinkPartition": "actorId001283_movieId4941828_in",
    "_rid": "5vNdAJWGC90ZAAAAAAAAAA==",
    "_self": "dbs/5vNdAA==/colls/5vNdAJWGC90=/docs/5vNdAJWGC90ZAAAAAAAAAA==/",
    "_etag": "\"7c006ffb-0000-0700-0000-5e8eb5950000\"",
    "_attachments": "attachments/",
    "_ts": 1586410901
}

However, when I created a similar relationship through the Azure CosmosDB Portal, the edge document has this shape.

{
    "id": "095cdba4-0a3f-4d79-b68f-92c13b3fb37e",
    "label": "ActedIn",
    "type": "edge",
    "inVLabel": "Movie",
    "outVLabel": "Actor",
    "inV": "movieId39138",
    "outV": "actorId239172"
  }

My initial thought is that the bulk executor was not adding any edges, but that doesn't appear to be the case. Instead, the edges that are being added are not in the correct shape for CosmosDb to actually treat them as edges.

The query g.E() does not return the edge documents created with the bulk executor, but does return the edge documents created through the Azure portal.

@AdamBremholm
Copy link

We are having the same problem, did you find a solution for this?

@nelsonwellswku
Copy link
Author

nelsonwellswku commented Oct 28, 2020

@AdamBremholm No, I did not. I ended up using the bulk insert for nodes and then created the edges between them without the help of the tool. It was painfully slow.

@AdamBremholm
Copy link

Thanks for the reply!
We resolved our issue by putting the same partition key as the id for each vertex and use the same partition key for at the edges.
Strange that it outputted that edges where created even though they were not when we tried it the first time without these settings.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants