Skip to content

[Feature][UDF] support LUA UDF #5977

Description

@stdpain
  1. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions