Aerospike:update() doesn't work in stream UDF


#1

I found that ‘record’ passed to map() function from stream cannot be updated using aerospike:update().

Is it an architectural “read only” approach for stream UDFs or I found a bug?

There are a few reasons for me to request this functionallity:

  1. Record UDFs can be applied either to all records or only 1 record. I want to modify only subset using secondary indexes.
  2. I’m using stream UDF to group records. On the last step I want to update each record in the group with ids of other records in the same group. Otherwise I’ll have to return groupping result to the client and make him execute update for each record in the group.

#2

Hi,

Yes, you’re right. It’s a feature. Record UDFs directly access the record, and can therefore perform updates on it. Stream UDFs only get a copy, so they do not have the capability of updating the base record.

Your proposed solution is correct. From the client, you’ll take the results of the query and use that to iterate through the set of record keys to update them individually via record UDF.