imay commented on a change in pull request #1140: Add SHOW FUNCTION and update docs for UDF URL: https://github.com/apache/incubator-doris/pull/1140#discussion_r283093673
########## File path: docs/documentation/cn/extending-doris/user-defined-function.md ########## @@ -0,0 +1,83 @@ +# USER DEFINED FUNCTION + +用户可以通过UDF机制来扩展Doris的能力。通过这篇文档,用户能够创建自己的UDF。 + +## 编写UDF函数 + +在使用UDF之前,用户需要先在Doris的UDF框架下,编写自己的UDF函数。在`be/src/udf_samples/udf_sample.h|cpp`文件中是一个简单的UDF Demo。 + +编写一个UDF函数需要以下几个步骤 + +### 编写函数 + +创建对应的头文件、CPP文件,在CPP文件中实现你需要的逻辑。CPP文件中的实现函数格式与UDF的对应关系。 + +#### 非可变参数 + +对于非可变参数的UDF,那么两者之间的对应关系很直接。 +比如`INT MyADD(INT, INT)`的UDF就会对应`IntVal AddUdf(FunctionContext* context, const IntVal& arg1, const IntVal& arg2)` + +1. `AddUdf`可以为任意的名字,只要创建UDF的时候指定即可 Review comment: OK ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
