-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-21300][docs] Update module-related documentation #15230
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 569104d (Tue Mar 16 08:09:29 UTC 2021) ✅no warnings Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
I'm also fine with updating myself if #15213 gets merged firstly. |
Hi @wuchong, could you mind taking a look at this PR? |
done |
-- +-------------+ | ||
-- | module name | | ||
-- +-------------+ | ||
-- | core | | ||
-- | hive | | ||
-- +-------------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no --
prefix printed in SQL Client.
|
||
The following grammar gives an overview of the available syntax: | ||
```sql | ||
LOAD MODULE `module_name` [WITH ('key1' = 'val1', 'key2' = 'val2', ...)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we explain what's the key1 val1 properties?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides, users don't need always escape the module_name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we explain what's the key1 val1 properties?
Yes, I think we'd better add a description to let users know how to design their own module and module factory impl.
[INFO] Unload module succeeded! | ||
|
||
Flink SQL> SHOW MODULES; | ||
-- Empty set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
|
||
The following grammar gives an overview of the available syntax: | ||
```sql | ||
UNLOAD MODULE `module_name` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users don't need always escape the module_name. UNLOAD MODULE module_name
is fine.
@@ -215,6 +251,11 @@ USE CATALOG catalog_name | |||
|
|||
设置当前的 catalog。所有后续命令未显式指定 catalog 的将使用此 catalog。如果指定的的 catalog 不存在,则抛出异常。默认的当前 catalog 是 `default_catalog`。 | |||
|
|||
## USE MODULES | |||
```sql | |||
USE MODULES `module_name1`[, `module_name2`, ...] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
|
||
展示当前环境激活的所有 module。 | ||
|
||
## SHOW FULL MODULES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to merge SHOW FULL MODUELS
into SHOW MODULES
, just like what we do for SHOW [USER] FUNCTIONS
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @LadyForest for the detailed documentation. It already looks in a good shape. I only left some minor comments.
Many thanks to @wuchong for the thorough review. I'll address your comments right now.
@@ -38,6 +38,8 @@ SHOW 语句用于列出所有的 catalog,或者列出当前 catalog 中所有 | |||
- SHOW TABLES | |||
- SHOW VIEWS | |||
- SHOW FUNCTIONS | |||
- SHOW MODULES | |||
- SHOW FULL MODULES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
-- +-------------+ | ||
-- | module name | | ||
-- +-------------+ | ||
-- | core | | ||
-- | hive | | ||
-- +-------------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
|
||
The following grammar gives an overview of the available syntax: | ||
```sql | ||
LOAD MODULE `module_name` [WITH ('key1' = 'val1', 'key2' = 'val2', ...)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
|
||
Objects provided by modules are considered part of Flink's system (built-in) objects; thus, they don't have any namespaces. | ||
A module can be loaded, enabled, disabled and unloaded. When TableEnvironment loads a module initially, it enables the module by default. Flink supports multiple modules and keeps track of the loading order to resolve metadata. *E.g.*, when there are two functions of the same name residing in two modules, Flink always resolves the function reference to the one in the 1st enabled module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to the one in the 1st enabled module.
This sounds we always resolve function by only looking up the first module which is incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to the one in the 1st enabled module.
This sounds we always resolve function by only looking up the first module which is incorrect.
Yes, it's somewhat misleading. While this is the original statement before I made this change. I'll do the rewrite to make it more accurate.
Thanks @LadyForest for the detailed documentation. It already looks in a good shape. I only left some minor comments. |
Hi @wuchong, I updated this PR according to your suggestions. Would you mind taking another look when you're free? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
What is the purpose of the change
This pull request is a subtask of FLINK-21045 to update the docs on module-related changes.
Brief change log
overview.md
, add links toLOAD
andUNLOAD
statement, update the reserved keywords(addMODULES
, the reason is [FLINK-21298][table] Support 'USE MODULES' syntax both in SQL parser, TableEnvironment and SQL CLI #15005 (comment)).load.md
andunload.md
to describeLOAD MODULE
andUNLOAD MODULE
usage.use.md
(add description ofUSE MODULES
) andshow.md
(add description ofSHOW MODULES/SHOW FULL MODULES
)modules.md
, add the description on module lifecycle, resolution order change etc.table_envirronment.md
, add links touse_modules
andlist_full_modules
Verifying this change
This change can be verified after rebuilding docs. I've updated myself to adapt FLINK-21774
Please note that at this moment, the output of.SHOW [FULL] MODULES
stills keeps table schema even if the output is empty, this should be updated together with FLINK-21774Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation