Hi everyone, I would like to start a discussion on FLINK-21045 [1] about supporting `LOAD MODULE` and `UNLOAD MODULE` SQL syntax. It's first proposed by FLIP-68 [2] as following.
-- load a module with the given name and append it to the end of the module list LOAD MODULE 'name' [WITH ('type'='xxx', 'prop'='myProp', ...)] --unload a module by name from the module list and other modules remain in the same relative positions UNLOAD MODULE 'name' After a round of discussion on the Jira ticket, it seems some unanswered questions need more opinions and suggestions. 1. The way to redefine resolution order easily Rui Li suggested introducing `USE MODULES` and adding similar functionality to the API because > 1) It's very tedious to unload old modules just to reorder them. 2) Users may not even know how to "re-load" an old module if it was not > initially loaded by the user, e.g. don't know which type to use. Jane Chan wondered that module is not like the catalog which has a concept of namespace could specify, and `USE` sounds like a mutual-exclusive concept. Maybe `RELOAD MODULES` can express upgrading the priority of the loaded module(s). 2. `LOAD/UNLOAD MODULE` v.s. `CREATE/DROP MODULE` syntax Jark Wu and Nicholas Jiang proposed to use `CREATE/DROP MODULE` instead of `LOAD/UNLOAD MODULE` because > 1) From a pure SQL user's perspective, maybe `CREATE MODULE + USE MODULE` > is easier to use rather than `LOAD/UNLOAD`. > 2) This will be very similar to what the catalog used now. Timo Walther would rather stick to the agreed design because loading/unloading modules is a concept known from kernels etc. 3. Simplify the module design by mapping modules purely by name LOAD MODULE geo_utils LOAD MODULE hive WITH ('version'='2.1') -- no dedicated 'type='/'module=' but allow only 1 module to be loaded parameterized UNLOAD hive USE MODULES hive, core Please find more details in the reference link. Looking forward to your feedback. [1] https://issues.apache.org/jira/browse/FLINK-21045# <https://cwiki.apache.org/confluence/display/FLINK/FLIP-68%3A+Extend+Core+Table+System+with+Pluggable+Modules> [2] https://cwiki.apache.org/confluence/display/FLINK/FLIP-68%3A+Extend+Core+Table+System+with+Pluggable+Modules Best, Jane