aerospike / aerospike-loader

Aerospike Data Loader
42 stars 37 forks source link

-wa update does not behave as expected. #12

Closed kaushal-l closed 5 years ago

kaushal-l commented 6 years ago

Hi, I have a test dsv file - set##key##LIVERAMP UserProperties##d4827a9fad61a970ba2d82c270d6e2aa##{"123456789":14931478280}

and corresponding json - { "version" : "2.0", "input_type" : "dsv", "dsv_config": { "delimiter": "##" , "n_columns_datafile": 3, "header_exist": true},

"mappings": [
    {
        "key": {"column_name":"key", "type": "string"},

        "set": { "column_name":"set" , "type": "string"},

        "bin_list": [
            {
                "name": "LIVERAMP",
                "value": {"column_name": "LIVERAMP", "type" : "json"}
            }
        ]
    }
]

}

I ran the following ->

./run_loader -h -n teststore -wa update_only -c example/liveramp.json example/liveramp.dsv

I was expecting {"123456789":14931478280} to get added to the record's bin. Instead, this record replaced the contents of the bin for that primary key.

Am I doing something wrong or is this the expected behavior? According to (https://www.aerospike.com/docs/tools/asloader/options.html) ,

The possible values are: 1) UPDATE - Create or update records. Merge incoming bin values with existing ones,

arrowplum commented 5 years ago

Write action is on record level not bin level. If you are writing new bins for already existing key then it will get merge (for update policy). But if you are writing already existing bin then it will get replaced. This is expected behaviour so closing this issue.