JingGe commented on code in PR #23796:
URL: https://github.com/apache/flink/pull/23796#discussion_r1404850904


##########
docs/content.zh/docs/dev/table/functions/udfs.md:
##########
@@ -1940,7 +1940,7 @@ public static class Top2 extends 
TableAggregateFunction<Tuple2<Integer, Integer>
 
 // 注册函数
 StreamTableEnvironment tEnv = ...
-tEnv.registerFunction("top2", new Top2());
+tEnv.createTemporarySystemFunction("top2", new Top2());

Review Comment:
   ditto



##########
docs/content.zh/docs/dev/table/functions/udfs.md:
##########
@@ -1797,7 +1797,7 @@ public static class Top2 extends 
TableAggregateFunction<Tuple2<Integer, Integer>
 
 // 注册函数
 StreamTableEnvironment tEnv = ...
-tEnv.registerFunction("top2", new Top2());
+tEnv.createTemporarySystemFunction("top2", new Top2());

Review Comment:
   ditto.
   
   It is recommended to use class over new instance for udf that can be 
instanced with no parameter, because the platform can add more logic to control 
the process of creating new instance underneath, e.g. validation which is the 
built-in standard logic in TableEnvironmentImpl. More logic or optimization 
could be added in the future with no impact on users' existing code. 



##########
docs/content.zh/docs/dev/table/tableApi.md:
##########
@@ -825,7 +825,7 @@ result = orders.over_window(Over
 Table orders = tEnv.from("Orders");
 
 // 对 user-defined aggregate functions 使用互异(互不相同、去重)聚合
-tEnv.registerFunction("myUdagg", new MyUdagg());
+tEnv.createTemporarySystemFunction("myUdagg", new MyUdagg());

Review Comment:
   ditto and followings...



##########
docs/content.zh/docs/dev/table/functions/udfs.md:
##########
@@ -1355,7 +1355,7 @@ class WeightedAvg extends AggregateFunction[JLong, 
CountAccumulator] {
 
 // 注册函数
 val tEnv: StreamTableEnvironment = ???
-tEnv.registerFunction("wAvg", new WeightedAvg())
+tEnv.createTemporarySystemFunction("wAvg", new WeightedAvg())

Review Comment:
   ditto



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to