...
If the user uses CREATA FUNCTION ... USING JAR statement to register the UDF, the general process is very simple, we only create the UDF in catalog by class name and store the path information of UDF resources. we neither check for resource available nor validity of the class exists because of `CREATE FUNCTION` CREATE FUNCTION
are pure metadata catalog operations in Flink.
...
Proposing a child-first user class loader called MutableURLClassLoader which contains a parent classloader, child-first owner classloader and URL list registered by user. This classloader supports add and remove jar url from it, so can modify the url dynamically.
- Proposing an internal interface UserResourceManager, this entity performs bookkeeping of used/loaded resources. This entity should also provide a MutableURLClassLoader which parent classloader originated from the class loader given via EnvironmentSettings. UserResourceManager is responsible for manager all used resources.
- The table environment directly refers UserResourceManager instead of ClassLoader object, to manager all jar resources get from related resource SQL syntax and add or remove the specific jar url to MutableURLClassLoader.
- FunctionCatalog also needs to refer UserResourceManager which is used to manager jar get from
CREATE FUNCTION ... USING JAR
syntax.
Migration Plan and Compatibility
...