You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/10/15 09:13:04 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #1985: Support prepare/close step in UDF process

morningman commented on a change in pull request #1985: Support prepare/close step in UDF process
URL: https://github.com/apache/incubator-doris/pull/1985#discussion_r334836221
 
 

 ##########
 File path: docs/documentation/en/sql-reference/sql-statements/Data Definition/create-function_EN.md
 ##########
 @@ -49,23 +53,33 @@ If the `function_name'contains the database name, the custom function will be cr
 
 1. Create a custom scalar function
 
-```
-CREATE FUNCTION my_add(INT, INT) RETURNS INT PROPERTIES (
-"Symbol"=""\\\\\\\\ zn9doris\\\ udf6addudfepns\\ FunctionContexterkns\\ INTVales 4\,
-"object file" ="http://host:port /libmyadd.so"
-);
-```
+	```
+	CREATE FUNCTION my_add(INT, INT) RETURNS INT PROPERTIES (
+	"Symbol"=""\\\\\\\\ zn9doris\\\ udf6addudfepns\\ FunctionContexterkns\\ INTVales 4\,
+	"object file" ="http://host:port /libmyadd.so"
+	);
+	```
+2. Create a custom scalar function with prepare/close functions
 
-2. Create a custom aggregation function
+	```
+	CREATE FUNCTION my_add(INT, INT) RETURNS INT PROPERTIES (
+   		"symbol" = 	"_ZN9doris_udf6AddUdfEPNS_15FunctionContextERKNS_6IntValES4_",
+   		"prepareFnSymbol" = "_ZN9doris_udf14AddUdf_prepareEPNS_15FunctionContextENS0_18FunctionStateScopeE",
+   		"closeFnSymbol" = "_ZN9doris_udf12AddUdf_closeEPNS_15FunctionContextENS0_18FunctionStateScopeE",
+    	"object_file" = "http://host:port/libmyadd.so"
+	);
+	```
 
-```
-CREATE AGGREGATE FUNCTION my_count (BIGINT) RETURNS BIGINT PROPERTIES (
-"init u fn"= "ZN9doris, udf9CountInitEPNS -u 15FunctionContextEPNS, u 9BigIntValE",
-"Update  fn" = " zn9doris \ udf11Countupdateepns \ \ FunctionContexterkns \ Intvalepns  bigintvale",
-"Merge fn"="\ zn9doris\\ udf10CountMergeepns\ \ FunctionContexterkns\ Bigintvaleps2\\\\\\\\\\\\\
-"Finalize \ fn" = "\ zn9doris \ udf13Count Finalizepns \\ FunctionContexterkns \ Bigintvale",
-"object" file ="http://host:port /libudasample.so"
-);
-```
+3. Create a custom aggregation function
+	
+	```
+	CREATE AGGREGATE FUNCTION my_count (BIGINT) RETURNS BIGINT PROPERTIES (
+	"init u fn"= "ZN9doris, udf9CountInitEPNS -u 15FunctionContextEPNS, u 9BigIntValE",
+	"Update  fn" = " zn9doris \ udf11Countupdateepns \ \ FunctionContexterkns \ Intvalepns  bigintvale",
 
 Review comment:
   these backslash may be generated by Baidu translator, can be removed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org