You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jane Chan (Jira)" <ji...@apache.org> on 2021/01/26 01:48:00 UTC

[jira] [Comment Edited] (FLINK-21045) Support 'load module' and 'unload module' SQL syntax

    [ 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/26/21, 1:47 AM:
-------------------------------------------------------------

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)}}.

Although
{quote}Objects in modules are loaded on demand instead of eagerly
{quote}
it requires all dependency jars to appear under classpath, and there's nothing to do with 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 the only feasible operation for `{{LOAD}}` is to load a new module. 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


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)}}.

Although
{quote}Objects in modules are loaded on demand instead of eagerly
{quote}
it requires all dependency jars to appear under classpath, and there's nothing to do with 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 the only feasible operation for `{{LOAD}}` is to load a new module. Thus the optional `{{WITH}}` may be necessary instead? 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)