zicat edited a comment on pull request #16163: URL: https://github.com/apache/flink/pull/16163#issuecomment-874613964
> Hi @zicat , it seems that we only have one problem: override copy. > I still feel it is dangerous, not only resultType, but also nullTerm, resultTerm and etc... It may brings a wrong result. > > I have tested `SELECT func(func(func(text))) FROM MyTable`. There is no `copy` invoking. Why not just remove `copy`? Let `ExternalGeneratedExpression` fallback to `GeneratedExpression` when `copy` occurred. > > Or show your case that `copy` occurred. See can we optimize it. You can debug the newest test case of flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/codegen/calls/BridgingFunctionGenUtilTest.java, It will invoke the ExternalGeneratedExpression copy method. Your testing I guess is the batch sql not streaming sql. Why I override copy method? Because If not override this method, The instance of ExternalGeneratedExpression invoke copy method will return the instance of GeneratedExpression that cause flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/BridgingFunctionGenUtil.scala#298 match fail making this issue not working -- 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]
