I am trying to run a fairly simple UDF stream witch runs through the entire set and calculates some statistics (simple counter).
I se two errors in two different scenarios:
When doing register through client and running through AQL I get a “unexpected symbol” error. When opening the LUA file on the server, I can see it prepends “.” symbol in the file and when I remove it, save and running again through AQL it works. (are there some issues in the file reading part of the client? Encoding maybe?)
When above are fixed and the AQL method works I try to run the same UDF from the client, but keeps getting the below error message: Query Failed: Method not found: ‘Neo.IronLua.LuaGlobal Neo.IronLua.Lua.CreateEnvironment()’. I can’t find anything about that error?
Code for register:
var clientDirectory = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "Aerospike\\LUA"); LuaConfig.PackagePath = clientDirectory + @"\?.lua"; var filename = "Statistics.lua"; var clientPath = Path.Combine(clientDirectory, filename); RegisterTask task = Handler.Client.Register(null, clientPath, filename, Language.LUA); task.Wait();
Code for execution:
var stmt = new Statement(); stmt.SetNamespace("nstest"); stmt.SetSetName("settest"); var resultSet = Aerospike.Client.QueryAggregate(null, stmt, "Statistics", "sum"); if (resultSet.Next()) ...
I hope you are able to help me - thanks