sv3ndk commented on a change in pull request #16060:
URL: https://github.com/apache/flink/pull/16060#discussion_r659128719
##########
File path:
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliStrings.java
##########
@@ -39,82 +39,171 @@ private CliStrings() {
public static final AttributedString MESSAGE_HELP =
new AttributedStringBuilder()
.append("The following commands are available:\n\n")
+ // About base commands.
+ .append(formatCommand("HELP", "Prints the available
commands."))
.append(formatCommand("CLEAR", "Clears the current
terminal."))
+ .append(formatCommand("QUIT / EXIT", "Quits the SQL CLI
client."))
+ // About "CREATE" statements commands.
+ .append("\n")
.append(
formatCommand(
- "CREATE TABLE",
- "Create table under current catalog and
database."))
+ "CREATE CATALOG",
+ "Creates a catalog. Syntax: \"CREATE
CATALOG <catalog_name> WITH ( '<k1>' = '<v1>', ...);\""))
.append(
formatCommand(
- "DROP TABLE",
- "Drop table with optional catalog and
database. Syntax: \"DROP TABLE [IF EXISTS] <name>;\""))
+ "CREATE DATABASE",
+ "Creates a database. Syntax: \"CREATE
DATABASE [IF NOT EXISTS] <db_name> [COMMENT <comment>] WITH ( '<k1>' = '<v1>',
...);\""))
+ .append(
+ formatCommand(
+ "CREATE TABLE",
+ "Creates table under current catalog and
database. Syntax: \"CREATE TABLE <table_name> ({<col1> <col1_type>}[, ...])
WITH ( '<k1>' = '<v1>', ...);\""))
.append(
formatCommand(
"CREATE VIEW",
- "Creates a virtual table from a SQL query.
Syntax: \"CREATE VIEW <name> AS <query>;\""))
+ "Creates a virtual table from a SQL query.
Syntax: \"CREATE VIEW <view_name> AS <query_statement>;\""))
+ .append(
+ formatCommand(
+ "CREATE FUNCTION",
+ "Creates a function. Syntax: \"CREATE
FUNCTION <func_name> AS <identifier> [LANGUAGE JAVA|SCALA|PYTHON];\""))
+ // About "DROP" statements commands.
+ .append("\n")
.append(
formatCommand(
- "DESCRIBE",
- "Describes the schema of a table with the
given name."))
+ "DROP CATALOG",
+ "Drops a catalog with the given catalog
name. Syntax: \"DROP CATALOG [IF EXISTS] <catalog_name>;\""))
+ .append(
+ formatCommand(
+ "DROP DATABASE",
+ "Drops a database with the given database
name. Syntax: \"DROP DATABASE [IF EXISTS] [<catalog_name>.]<db_name> [
(RESTRICT | CASCADE) ];\""))
+ .append(
+ formatCommand(
+ "DROP TABLE",
+ "Drops a table with optional catalog and
database. Syntax: \"DROP TABLE [IF EXISTS]
[<catalog_name>.][<db_name>.]<table_name>;\""))
.append(
formatCommand(
"DROP VIEW",
- "Deletes a previously created virtual
table. Syntax: \"DROP VIEW <name>;\""))
+ "Drops a previously created virtual table.
Syntax: \"DROP [TEMPORARY] VIEW [IF EXISTS]
[<catalog_name>.][<db_name>.]<view_name>;\""))
+ .append(
+ formatCommand(
+ "DROP FUNCTION",
+ "Drops a catalog function that has catalog
and database namespaces. Syntax: \"DROP FUNCTION
[<catalog_name>.][<db_name>.]<func_name>;\""))
+ // About "ALTER" statements commands.
+ .append("\n")
+ .append(
+ formatCommand(
+ "ALTER DATABASE",
+ "Sets one or more properties in the
specified database. Syntax: \"ALTER DATABASE [<catalog_name>.]<db_name> SET (
'<k1>' = '<v1>', ...);\""))
+ .append(
+ formatCommand(
+ "ALTER TABLE",
+ "Alters a registered table definition.
Syntax: \"ALTER TABLE <table_name> { RENAME TO <new_table_name> } | { SET (
'<k1>' = '<v1>', ...) };\""))
+ .append(
+ formatCommand(
+ "ALTER FUNCTION",
+ "Alters a catalog function with the new
identifier and optional language tag. Syntax: \"ALTER FUNCTION <func_name> AS
<identifier> [LANGUAGE JAVA|SCALA|PYTHON];\""))
+ // About "DESCRIBE / DESC" statements commands.
+ .append("\n")
+ .append(
+ formatCommand(
+ "DESCRIBE / DESC",
+ "Describes the schema of a table or a view
with the given name. Syntax: \"{ DESCRIBE | DESC } <table_or_view__name>;\""))
+ // About "EXPLAIN" statements commands.
+ .append("\n")
.append(
formatCommand(
"EXPLAIN",
- "Describes the execution plan of a query
or table with the given name."))
- .append(formatCommand("HELP", "Prints the available
commands."))
+ "Explains the logical and optimized query
plans of a query or an INSERT statement. Syntax: \"EXPLAIN PLAN FOR
<query_or_insert__statement>;\""))
+ // About "USE" statements commands.
+ .append("\n")
.append(
formatCommand(
- "INSERT INTO",
- "Inserts the results of a SQL SELECT query
into a declared table sink."))
+ "USE",
+ "Sets the current default database.
Experimental! Syntax: \"USE [<catalog_name>.]<database_name>;\""))
.append(
formatCommand(
- "INSERT OVERWRITE",
- "Inserts the results of a SQL SELECT query
into a declared table sink and overwrite existing data."))
- .append(formatCommand("QUIT", "Quits the SQL CLI client."))
+ "USE CATALOG",
+ "Sets the current catalog. The current
database is set to the catalog's default one. Experimental! Syntax: \"USE
CATALOG <catalog_name>;\""))
.append(
formatCommand(
- "RESET",
- "Resets a session configuration property.
Syntax: \"RESET '<key>';\". Use \"RESET;\" for reset all session properties."))
+ "USE MODULES",
+ "Enables loaded modules. Syntax: \"USE
MODULES <module_name1>[, ...];\""))
+ // About "SHOW" statements commands.
+ .append("\n")
.append(
formatCommand(
- "SELECT", "Executes a SQL SELECT query on
the Flink cluster."))
+ "SHOW CATALOGS",
+ "Shows all catalogs. Syntax: \"SHOW
CATALOGS;\""))
.append(
formatCommand(
- "SET",
- "Sets a session configuration property.
Syntax: \"SET '<key>'='<value>';\". Use \"SET;\" for listing all properties."))
+ "SHOW CURRENT CATALOG",
+ "Shows current catalog. Syntax: \"SHOW
CURRENT CATALOG;\""))
+ .append(
+ formatCommand(
+ "SHOW DATABASES",
+ "Shows all databases in the current
catalog. Syntax: \"SHOW DATABASES;\""))
+ .append(
+ formatCommand(
+ "SHOW CURRENT DATABASE",
+ "Shows current database. Syntax: \"SHOW
CURRENT DATABASE;\""))
.append(
formatCommand(
"SHOW FUNCTIONS",
"Shows all user-defined and built-in
functions or only user-defined functions. Syntax: \"SHOW [USER] FUNCTIONS;\""))
- .append(formatCommand("SHOW TABLES", "Shows all registered
tables."))
.append(
formatCommand(
- "SOURCE",
- "Reads a SQL SELECT query from a file and
executes it on the Flink cluster."))
+ "SHOW TABLES",
+ "Shows all registered tables. Syntax:
\"SHOW TABLES;\""))
.append(
formatCommand(
- "USE CATALOG",
- "Sets the current catalog. The current
database is set to the catalog's default one. Experimental! Syntax: \"USE
CATALOG <name>;\""))
+ "SHOW VIEWS",
+ "Shows all views in the current catalog
and the current database. Syntax: \"SHOW VIEWS;\""))
.append(
formatCommand(
- "USE",
- "Sets the current default database.
Experimental! Syntax: \"USE <name>;\""))
+ "SHOW MODULES",
+ "Shows all enabled module names with
resolution order. Syntax: \"SHOW [FULL] MODULES;\""))
+ // About "LOAD/UNLOAD MODULE" statements commands.
+ .append("\n")
.append(
formatCommand(
"LOAD MODULE",
- "Load a module. Syntax: \"LOAD MODULE
<name> [WITH ('<key1>' = "
- + "'<value1>' [, '<key2>' =
'<value2>', ...])];\""))
+ "Loads a built-in or user-defined module.
Syntax: \"LOAD MODULE <module_name> [WITH ('<k1>' = '<v1>', ...)];\""))
.append(
formatCommand(
"UNLOAD MODULE",
- "Unload a module. Syntax: \"UNLOAD MODULE
<name>;\""))
+ "Unloads a built-in or user-defined
module. Syntax: \"UNLOAD MODULE <module_name>;\""))
+ // About "INSERT" statements commands.
+ .append("\n")
.append(
formatCommand(
- "USE MODULES",
- "Enable loaded modules. Syntax: \"USE
MODULES <name1> [, <name2>, ...];\""))
+ "INSERT INTO",
+ "Inserts the results of a SQL SELECT query
into a declared table sink."))
+ .append(
+ formatCommand(
+ "INSERT OVERWRITE",
+ "Inserts the results of a SQL SELECT query
into a declared table sink and overwrite existing data."))
+ // About "SET/RESET" statements commands.
+ .append("\n")
+ .append(
+ formatCommand(
+ "SET",
+ "Sets a session configuration property.
Syntax: \"SET <key>=<value>;\". Use \"SET;\" for listing all properties."))
+ .append(
+ formatCommand(
+ "RESET",
+ "Resets a session configuration property.
Syntax: \"RESET <key>;\". Use \"RESET;\" for reset all session properties."))
+ // About "SELECT" statements commands.
+ .append("\n")
Review comment:
3 new commands were added recently to tune the classloader of the jobs
when submitted to the Flink cluster, could you please document them as well ?
Something along those lines I guess:
```
.append(
formatCommand(
"ADD JAR",
"Adds the specified jar file to the
submitted jobs' classloader. Syntax: \"ADD JAR '/path/to/some/filename.jar'""))
.append(
formatCommand(
"REMOVE JAR",
"Removes the specified jar file from
the submitted jobs' classloader. Syntax: \"REMOVE JAR
'/path/to/some/filename.jar'""))
.append(
formatCommand(
"SHOW JARS",
"Shows the list of user-specified jar
dependencies. This list is impacted by the --jar and --library startup options
as well as the ADD/REMOVE JAR commands."))
.append("\n")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]