Contribute UDF
Contribute UDF
This manual mainly introduces how external users can contribute their own UDF functions to the Doris community.
Prerequisitesโ
UDF function is universal
The versatility here mainly refers to: UDF functions are widely used in certain business scenarios. Such UDF functions are valuable and can be used directly by other users in the community.
If you are not sure whether the UDF function you wrote is universal, you can send an email to
dev@doris.apache.org
or directly create an ISSUE to initiate the discussion.UDF has completed testing and is running normally in the user's production environment
Ready to workโ
- UDF source code
- User Manual of UDF
Source codeโ
Create a folder for UDF functions under contrib/udf/src/
, and store the source code and CMAKE files here. The source code to be contributed should include: .h
, .cpp
, CMakeFile.txt
. Taking udf_samples as an example here, first create a new folder under the contrib/udf/src/
path and store the source code.
โโโcontrib
โ โโโ udf
โ โโโ CMakeLists.txt
โ โโโ src
โ โโโ udf_samples
โ โโโ CMakeLists.txt
โ โโโ uda_sample.cpp
โ โโโ uda_sample.h
โ โโโ udf_sample.cpp
โ โโโ udf_sample.h
CMakeLists.txt
After the user's
CMakeLists.txt
is placed here, a small amount of changes are required. Just removeinclude udf
andudf lib
. The reason for the removal is that it has been declared in the CMake file at thecontrib/udf
level.
manualโ
The user manual needs to include: UDF function definition description, applicable scenarios, function syntax, how to compile UDF, how to use UDF in Doris, and use examples.
The user manual must contain both Chinese and English versions and be stored under
docs/zh-CN/extending-doris/contrib/udf
anddocs/en/extending-doris/contrib/udf
respectively.โโโ docs
โย ย โโโ zh-CN
โย ย โโโextending-doris
โ โโโudf
โ โโโcontrib
โ โโโ udf-simple-manual.mdโโโ docs
โย ย โโโ en
โย ย โโโextending-doris
โ โโโudf
โ โโโcontrib
โ โโโ udf-simple-manual.mdAdd the two manual files to the sidebar in Chinese and English.
vi docs/.vuepress/sidebar/zh-CN.js
{
title: "็จๆท่ดก็ฎ็ UDF",
directoryPath: "contrib/",
children:
[
"udf-simple-manual",
],
},vi docs/.vuepress/sidebar/en.js
{
title: "Users contribute UDF",
directoryPath: "contrib/",
children:
[
"udf-simple-manual",
],
},
Contribute UDF to the communityโ
When you meet the conditions and prepare the code, you can contribute UDF to the Doris community after the document. Simply submit the request (PR) on Github. See the specific submission method: Pull Request (PR).
Finally, when the PR assessment is passed and merged. Congratulations, your UDF becomes a third-party UDF supported by Doris. You can check it out in the ecological expansion section of Doris official website~.