Large list filter


#1

Hello,

Just found another one, what about aerospike_llist_filter, or any other filter methods? They use params as follows:


as_status aerospike_llist_filter(
  aerospike * as,
  as_error * err,
  const as_policy_apply * policy,
  const as_key * key,
  const as_ldt * ldt,
  const as_udf_function_name filter,
  const as_list * filter_args,
  as_list ** elements 
)		

but according to information about ldt advanced in http://www.aerospike.com/docs/guide/ldt_advanced.html, they need also module name like in aerospike_key_apply. I thought maybe it gets module from initial one in as_ldt_init:

local llist_settings = require("ldt/lib_llist")
local mymodule = {}

function mymodule.adjust_settings(ldtMap)
  local configMap = map();
  configMap['MaxObjectSize'] = 200000
  llist_settings.compute_settings(ldtMap, configMap)
  info ("setting LDT to be %d",configMap['MaxObjectSize'])
end

function mymodule.my_filter_func(ldt_key,args)
    if (ldt_key % args[1])==0 then
        return ldt_key
    else
        return nil
    end
end

return mymodule;

but then, when i passed my_filter_func to it, I’ve got an error:

/opt/aerospike/sys/udf/lua/ldt/ldt_common.lua:1056: 1411:LDT-Null Bin Name -- Error code: 100, at: [src/main/aerospike/as_command.c:822]

#2

I ran into the same bug a while ago. The next release of the C client (3.1.25) should include the fix for those filter functions getting the correct arguments.