zhuxiaoshang commented on a change in pull request #13225: URL: https://github.com/apache/flink/pull/13225#discussion_r487680982
########## File path: docs/dev/user_defined_functions.zh.md ########## @@ -114,30 +119,31 @@ data.reduce { (i1,i2) => i1 + i2 } data.reduce { _ + _ } {% endhighlight %} +<a name="rich-functions"></a> + ## Rich functions -All transformations that take as argument a lambda function can -instead take as argument a *rich* function. For example, instead of +所有将 lambda 表达式作为参数的转化操作都可以用 *rich* function 来代替。例如,代替 {% highlight scala %} data.map { x => x.toInt } {% endhighlight %} -you can write +你可以写成 {% highlight scala %} class MyMapFunction extends RichMapFunction[String, Int] { def map(in: String):Int = { in.toInt } }; {% endhighlight %} -and pass the function to a `map` transformation: +并将函数传递给 `map` transformation: {% highlight scala %} data.map(new MyMapFunction()) {% endhighlight %} -Rich functions can also be defined as an anonymous class: +富函数也可以定义成匿名类: Review comment: yes,it's should be resvered as `function` ---------------------------------------------------------------- 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: us...@infra.apache.org