Use the CREATE FUNCTION statement to identify the file name and location of the source code and install it on the server.
The function is compiled, linked to the dynamic linked library (DLL or SO) associated with the database in which the function resides, and distributed to all database nodes in the system.
Note that all the UDFs and external stored procedures that are defined in a specific database are linked into a single dynamically linked library.