Maps aren't being treated as maps in UDF from Java Client

Hi, I’m trying to pass bins to UDF function as a map from Java client and I expect it to be a lua table. However on the UDF side I’m getting userdata type. I found similar issue on github but it’s for GO client:

Here is the client code example:

client.execute(writePolicy,
           key,
           config.udfConfig.packageName,
           config.udfConfig.functionName,
           Value.get(new java.util.HashMap[String, Object]()))

And here is UDF:

function example(rec, bins)
    info("VALUE OF bins: %s", tostring(bins))
    info("TYPE OF bins: %s", type(bins))
end

tostring function on bins returns valid data. Something like {“foo”:62 61 72, “baz”:62 61 7A} but it has userdata type and I can’t do anything with it.

Is there a way to fix this? Thanks

I found a solution. It’s possible to work with this object using map functions like map.pairs() as described here: https://www.aerospike.com/docs/udf/api/map.html

This topic was automatically closed 84 days after the last reply. New replies are no longer allowed.