pyflink.table.table_environment.TableEnvironment.register_function#
- TableEnvironment.register_function(name: str, function: pyflink.table.udf.UserDefinedFunctionWrapper)[source]#
Registers a python user-defined function under a unique name. Replaces already existing user-defined function under this name.
Example:
>>> table_env.register_function( ... "add_one", udf(lambda i: i + 1, result_type=DataTypes.BIGINT())) >>> @udf(result_type=DataTypes.BIGINT()) ... def add(i, j): ... return i + j >>> table_env.register_function("add", add) >>> class SubtractOne(ScalarFunction): ... def eval(self, i): ... return i - 1 >>> table_env.register_function( ... "subtract_one", udf(SubtractOne(), result_type=DataTypes.BIGINT()))
- Parameters
name – The name under which the function is registered.
function – The python user-defined function to register.
New in version 1.10.0.
Note
Deprecated in 1.12. Use
create_temporary_system_function()
instead.