Open JJ11teen opened 6 years ago
Hi. I also require this feature. Were you able to accomplish this.
Unfortunately not, I ended up sort of writing my own version of this library (and unfortunately it was commercial so I can't share it). It was basically a thin wrapper which took in JSON in the form returned by the Cosmos SQL API and added some helper functions and typed out some known properties for gremlin graphson objects. There was a lot of backwards engineering using the Cosmos query explorer in the portal (insert with gremlin then query with SQL to see what form it takes). It turns out I didn't need a lot of the more advanced configurations around concurrency and sorting memory.
@JJ11teen : I see a GUID is mapped to id of each property doc Eg:[Prop1.id=4475269e-78d2-4708-9737-7142044658da"] in below sample JSON Doc. If you have created custom bulk insertor,may i know is it just at random you are generating this id or any rationale/logic is followed in generating it.
{ "label": "company", "Prop1": [ { "_value": "1", "id": "4475269e-78d2-4708-9737-7142044658da" } ], "Prop2": [ { "_value": "Tata Sons", "id": "04592b58-b445-4fd3-8133-c781c525e68e" } ], "id": "e23c4fcc-d401-4ad2-90ea-d4386e9b038d", "_rid": "pZVBAIP3p1gBAAAAAAAAAA==", "_self": "dbs/pZVBAA==/colls/pZVBAIP3p1g=/docs/pZVBAIP3p1gBAAAAAAAAAA==/", "_etag": "\"c6005dcf-0000-0300-0000-5c8f66160000\"", "_attachments": "attachments/", "_ts": 1552901654 }
I just used a random/new guid. (Guid.NewGuid()
)
Any performance implication in Read/Write RUs observed because you switch between API [SQL & Gremlin] for Read and Writes.
I found the bulk SQL to be much more performant, as well as being able to handle retrying partial requests (meaning large queries were more likely to eventually go through, rather than failing outright).
I also can't say I noticed any degraded performance on the Gremlin side after using my bulk method if that's what you mean, but I have been struggling with Gremlin performance from the onset (Gremlin performance was the reason for doing bulk SQL insertion initially). There were some performance improvements announced for the Gremlin parser a while ago but I haven't been on the project since then.
The GremlinVertexProperty class seems to have methods for accessing existing meta properties but not creating/assigning them. Can someone please point to the correct method to accomplish this?