awslabs / amazon-neptune-tools

Tools and utilities to enable loading data and building graph applications with Amazon Neptune.
Apache License 2.0
300 stars 152 forks source link

[csv-to-neptune-bulk-format] : upsert #280

Open chetanpatilofficial opened 1 year ago

chetanpatilofficial commented 1 year ago

I have a scenario where I want to upsert the node properties whenever we have multiple record with same key but change in property values. I tried to test this scenario by modifying the Spotify dataset(modified track_popularity) like below for Track Node: image

But as this is a duplicate record as per the uniqueKey, final Track.csv is not generating both the record.

Is there anyway using csv-to-neptune-bulk-format utility i can upsert if same uniqueKey record present in incoming data csv ?

triggan commented 1 year ago

You can use the bulk loader for upserts under two conditions:

You would also need to change the csv-to-neptune config file so that the properties that you want to update are single cardinality (or, isMultiValue = false).

[1] https://docs.aws.amazon.com/neptune/latest/userguide/bulk-load-tutorial-format-gremlin.html#bulk-load-tutorial-format-gremlin-propheaders [2] https://docs.aws.amazon.com/neptune/latest/userguide/load-api-reference-load.html