Hi Alan,

thanks for starting this small FLIP. A new method in FunctionDefinition makes a lot of sense and the lack of it was an issue in past already. We should clearly separate determinism and constant folding behavior.

Since FunctionDefinition is kind of a declaration, it should rather read declarative as well. I suggest to call this method `supportsConstantFolding`. `allow` sounds like one could influence the state of the function from the outside.

Otherwise +1 for the FLIP.

Regards,
Timo


On 30.04.24 00:57, Alan Sheinberg wrote:
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


Reply via email to