我的 lua 代码来自官方网站的示例:
local function one(rec)
info("lalalalal %s",rec['id'])
return 1
end
local function add(a, b)
return a + b
end
function mycount(stream)
return stream : map(one) : reduce(add);
end
当我使用 aql 命令时:
日志中的错误,例如吹:
2015 年 5 月 20 日 07:12:07 GMT:调试(udf):(udf_rw.c:send_result:515)调用 stream_udf mycount /opt/aerospike/usr/udf/lua/stream_udf.lua:10 时失败:尝试调用方法'map'(零值)2015 年 5 月 20 日 07:12:07 GMT:调试(udf):(udf_rw.c:send_udf_failure:403)非特殊 LDT 或一般 UDF 错误(/opt/aerospike/usr/udf/ lua/stream_udf.lua:10: 尝试调用方法 'map' (一个 nil 值))
如何解决?谢谢