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


##########
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 Flink as the framework 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. 



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