Search code examples
luaaerospike

Aerospike - what are the max number of parameters that can be passed to a query


When I pass too many arguments to a UDF function (LUA script) in aerospike I get an error which says "An incorrect number of type args were specified for the declaration of a Func type.".

I was trying to pass 5k values as a list, one "Value" which had 5k string objects in them. I tried it with 100 and it still gave me the problem, however it worked for 10.

The calling code looks something like:

var statement = new Statement();

statement.SetNamespace("blah");
statement.SetSetName("blu");
statement.SetBinNames("blee");

using (var result = Client.QueryAggregate(new QueryPolicy()
                                                          {
                                                              timeout = 600000
                                                          }, statement, packageName, functionName, parameters))
            {
                while (result.Next())
                {
                    retVal.Add((T) result.Object);
                }
            }

Aerospike team, any idea what is the max number I can pass here in the list param in the LUA udf? Is there any way to expand this?

*This is a background method which is run twice a day, performance is not of much importance here.


Solution

  • Lua seems to be unhappy with a large number of parameters (over 50). You should parameterize a Map() or table and pass that as one argument, then unpack it inside your lua function.

    See the Known Limitations section of the UDF Guide.