- create a lua function
-- create udf function int (int,int)CREATEFUNCTIONlua_add(int,int) RETURNS int properties (
"type"="LUA",
"symbol"="LUA_ADD",
"object_file"="http://127.0.0.1:8097/ans.lua"
);
-- create udf function string (string,string)CREATEFUNCTIONlua_cat(varchar(50),varchar(50)) RETURNS varchar(50) properties (
"type"="LUA",
"symbol"="LUA_STRCAT",
"object_file"="http://127.0.0.1:8097/ans2.lua"
);
ans.lua:
functionLUA_ADD(a, b)
returna+b;
endreturn1
ans2.lua
functionLUA_STRCAT(a,b)
returnstring.format("%s %s",a,b);
end
ans.lua:
ans2.lua