[ https://issues.apache.org/jira/browse/FLINK-4883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15728278#comment-15728278 ]
ASF GitHub Bot commented on FLINK-4883: --------------------------------------- Github user Renkai commented on the issue: https://github.com/apache/flink/pull/2729 Hi, @aljoscha I think the case make sense not only when parallelsim is 1,but also users knows the code would be execute in parallel and the code is thread safe and they may want to reduce some resource like memory or network connection.However, even we totaly forbidden a scala object to extend a UDF function, they can still refer to a scala object in UDF which may cause concurrent exceptions. > Prevent UDFs implementations through Scala singleton objects > ------------------------------------------------------------ > > Key: FLINK-4883 > URL: https://issues.apache.org/jira/browse/FLINK-4883 > Project: Flink > Issue Type: Bug > Reporter: Stefan Richter > Assignee: Renkai Ge > > Currently, user can create and use UDFs in Scala like this: > {code} > object FlatMapper extends RichCoFlatMapFunction[Long, String, (Long, String)] > { > ... > } > {code} > However, this leads to problems as the UDF is now a singleton that Flink > could use across several operator instances, which leads to job failures. We > should detect and prevent the usage of singleton UDFs. -- This message was sent by Atlassian JIRA (v6.3.4#6332)