Hi there
I’m trying to use Stream UDFs to filter results to match sets, and i’m just starting out with an incredibly basic matching UDF, however i’m finding that the UDF doesn’t seem to work properly, complaining that the filter method doesn’t exist.
here’s the UDF i’m trying to use:
local function limitation_filter(zone)
return function(record)
if record['dev_long'] == "Ubuntu" then
return true
else
return false
end
end
end
function stream_rows_udf(stream, zone)
local limfilter = limitation_filter(limitations)
return stream : filter(limfilter)
end
and i’m calling it with
aql> execute devfilter.stream_rows_udf(‘Macintosh’) on forecast.betapig4 where PK = 890
and i get this response:
Error: (100) /opt/aerospike/usr/udf/lua/devfilter.lua:13: attempt to call method ‘filter’ (a nil value)
any help would be greatly appreciated.