I'd like to start a discussion of FLIP-452: Allow Skipping Invocation of Function Calls While Constant-folding [1]
This feature proposes adding a new method FunctionDefinition.allowConstantFolding() as part of the Flink Table/SQL API. This would be used to determine whether an expression containing this function should have constant-folding logic run on it, invoking the function at planning time. The current behavior of always doing constant-folding on function calls is problematic for UDFs which invoke RPCs or have other side effects in external systems. In these cases, you either don’t want these actions to occur during planning time, or it may be important to happen on a per result row basis. Note that this is a bit different than FunctionDefinition.isDeterministic(), and can exist along-side it. Looking forward to your feedback and suggestions. [1] https://cwiki.apache.org/confluence/display/FLINK/FLIP-452%3A+Allow+Skipping+Invocation+of+Function+Calls+While+Constant-folding Thanks, Alan