[
https://issues.apache.org/jira/browse/FLINK-21045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17271508#comment-17271508
]
Jane Chan edited comment on FLINK-21045 at 1/29/21, 7:44 PM:
-------------------------------------------------------------
Hi [~jark], [~nicholasjiang], I apologized for the late reply.
Before creating subtasks, I'd like to clarify this improvement's goal and raise
some questions on non-trivial implementation details to ensure we're on the
same page. Please correct me if I'm wrong.
h4. The goal of this improvement
Support the SQL syntax on module operation. To be specific, support `{{LOAD
MODULE name [WITH (‘type’=’xxx’, 'prop'='myProp', ...)]`}} which corresponds to
{{tableEnv.loadModule(name, module)}} and `{{UNLOAD MODULE name`}} which
corresponds to {{tableEnv.unloadModule(name)}}.
According to FLIP-68
{quote}Objects in modules are loaded on demand instead of eagerly
{quote}
it requires all dependency jars to appear under classpath, and this improvement
will not involve dynamic module jar loading.
h4. The ground truth
# FLIP-68 proposed the SQL syntax`{{LOAD MODULE name [WITH (‘type’=’xxx’,
'prop'='myProp', ...)] }}`
# Currently, load an already-loaded module will throw an exception. (See
[ModuleManager.java#L74|https://github.com/apache/flink/blob/master/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/module/ModuleManager.java#L74])
h4. My question
Based on this implementation, if module {{X}} has been loaded before(say define
in the YAML file), should `{{LOAD MODULE X}}` throw an exception, too? If so,
it makes `{{LOAD MODULE name}}` less meaningful because <1> if the module is
loaded before, an exception will be thrown. <2> if it's a new module, then
without specifying properties the TableFactoryService cannot find the suitable
factory. Thus the optional `{{WITH}}` may be necessary instead? On the other
hand, if users want to shift the resolution order on loaded modules, it could
be concise to only provide the module names rather than a long property list,
how about providing `{{RELOAD MODULE X}}` instead of `{{LOAD MODULE X}}`, which
describes changing the resolution order of a loaded module {{X}}. (It may
beyond the scope of this improvement, I'm just wondering).
Another question is currently {{SHOW MODULES}} is not supported by
{{FlinkSqlParserImpl}} (FLINK-17396 tracks this), do we have plans to support
it?
Best, Jane
was (Author: qingyue):
Hi [~jark], [~nicholasjiang], I apologized for the late reply.
Before creating subtasks, I'd like to clarify this improvement's goal and raise
some questions on non-trivial implementation details to ensure we're on the
same page. Please correct me if I'm wrong.
h4. The goal of this improvement
Support the SQL syntax on module operation. To be specific, support `{{LOAD
MODULE name [WITH (‘type’=’xxx’, 'prop'='myProp', ...)]`}} which corresponds to
{{tableEnv.loadModule(name, module)}} and `{{UNLOAD MODULE name`}} which
corresponds to {{tableEnv.unloadModule(name)}}.
According to FLIP-68
{quote}Objects in modules are loaded on demand instead of eagerly
{quote}
it requires all dependency jars to appear under classpath, and this improvement
will not involve dynamic module jar loading.
h4. The ground truth
# FLIP-68 proposed the SQL syntax`{{LOAD MODULE name [WITH (‘type’=’xxx’,
'prop'='myProp', ...)] }}`
# Currently, load an already-loaded module will throw an exception. (See
[ModuleManager.java#L74|https://github.com/apache/flink/blob/master/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/module/ModuleManager.java#L74])
h4. My question
Based on this implementation, if module {{X}} has been loaded before(say define
in the YAML file), should `{{LOAD MODULE X}}` throw an exception, too? If so,
it makes `{{LOAD MODULE name}}` less meaningful because <1> if the module is
loaded before, an exception will be thrown. <2> if it's a new module, then
without specifying properties the TableFactoryService cannot find the suitable
factory. Thus the optional `{{WITH}}` may be necessary instead? (Or throw an
exception is ok?) On the other hand, if we want to describe an operation
performed on module name only, is it possible to`{{RELOAD MODULE X}}` instead
of `{{LOAD MODULE X}}`, which describes changing the resolution order of a
loaded module {{X}}. (It may beyond the scope of this improvement, I'm just
wondering).
Another question is currently {{SHOW MODULES}} is not supported by
{{FlinkSqlParserImpl}} (FLINK-17396 tracks this), do we have plans to support
it?
Best, Jane
> Support 'load module' and 'unload module' SQL syntax
> ----------------------------------------------------
>
> Key: FLINK-21045
> URL: https://issues.apache.org/jira/browse/FLINK-21045
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / Planner
> Affects Versions: 1.13.0
> Reporter: Nicholas Jiang
> Assignee: Jane Chan
> Priority: Major
> Fix For: 1.13.0
>
>
> At present, Flink SQL doesn't support the 'load module' and 'unload module'
> SQL syntax. It's necessary for uses in the situation that users load and
> unload user-defined module through table api or sql client.
> SQL syntax has been proposed in FLIP-68:
> https://cwiki.apache.org/confluence/display/FLINK/FLIP-68%3A+Extend+Core+Table+System+with+Pluggable+Modules
--
This message was sent by Atlassian Jira
(v8.3.4#803005)