dylanhz commented on code in PR #27613:
URL: https://github.com/apache/flink/pull/27613#discussion_r2851227928


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/CodeGeneratorContext.scala:
##########
@@ -837,6 +840,12 @@ class CodeGeneratorContext(
       contextArgs: Seq[String] = null): String = {
     val classQualifier = function.getClass.getName
     val fieldTerm = CodeGenUtils.udfFieldName(function)
+    // check if function has been added before to avoid duplicate function 
instances

Review Comment:
   I added unit tests in `CodeGeneratorContextTest` that directly asserts 
`references.size` after calling `addReusableFunction` with the same/different 
functions, covering stateless dedup, stateful dedup, and stateful non-dedup 
cases.



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