I am trying to upload a simple csv into an Orient DB instance. My requirement is to update the existing vertex if the "Name" attribute is already present, else create a new record.
Even though the ETL executes without any exception, the IsDown attribute in the vertex isn't updated to the new value.
If I remove "skipDuplicates" : true, then there is an exception while trying to insert a duplicate value. - Duplicate key found
I am using Unique_has_index on CustomerService.Name
Please suggest how can I update attribute values for Vertex using OrientDB ETL
The csv is of the below mentioned format:
Name,IsDown
ABC,0
XYZ,0
ABC,0
DEF,0
FGH,0
And the json file is as below:
{
config: { log: "debug" },
"source" : { "file" : {"path": "C:\Users\innchoudh\Desktop\orientdb\customer.csv"} },
"extractor" : {"csv": {} },
"transformers": [
{ "merge": { "joinFieldName":"Name", "lookup":"CustomerService.Name" } },
{ "vertex": { "class":"CustomerService", "skipDuplicates": true} } ],
"loader" : {
"orientdb": {
"dbURL": "remote:localhost/Smarts",
"dbUser" : "admin",
"dbPassword" : "admin",
"dbType": "graph",
"tx" : true,
"batchCommit" : 1000
}
}
}
I even tried to execute the script in a different way, but this is throwing exceptions:
{
config: { "log": "debug" },
"source" : { "file" : {"path": "C:\Users\innchoudh\Desktop\orientdb\customer.csv"} },
"extractor" : {"row": {} },
"transformers": [
{"csv" : {"separator" : "," , "skipFrom" :1, "skipTo" :1 }}
{ "log": {} }
"command" : { "command" : "UPDATE CustomerService set CustomerService.IsDown = $input.IsDown UPSERT where CustomerService.Name = $input.Name"}
],
"loader" : {
"orientdb": {
"dbURL": "remote:localhost/Smarts",
"dbUser" : "admin",
"dbPassword" : "admin",
"dbType": "graph",
"tx" : true,
"batchCommit" : 1000
}
}
}