Variable-Length Argument List

Each argument is named explicitly in the signature of your C++ function. A UDF can take a fixed number of these named arguments, however a function can accept additional arguments if they are all of the same type.

You must code the signature of your function using the following format if you want your UDF to accept a variable-length argument list:

StringVal Concat(FunctionContext* context, const StringVal& separator, int num_var_args, const StringVal* args);

The SQL query call must pass at least one argument to the variable-length portion of the argument list. Impala calls the function and fills in the initial set of required arguments and then passes the extra arguments and a pointer to the first of the optional arguments.