luoyuxia commented on code in PR #22927:
URL: https://github.com/apache/flink/pull/22927#discussion_r1250536463
##########
docs/content/docs/dev/table/sql/alter.md:
##########
@@ -330,14 +330,20 @@ ALTER TABLE [IF EXISTS] table_name {
<computed_column_definition>:
AS computed_column_expression
+
+<partition_component>:
+ PARTITION (key1=val1, key2=val2, ...)
+
+<partition_add_component>:
Review Comment:
we won't need it
##########
docs/content/docs/dev/table/sql/alter.md:
##########
@@ -354,6 +360,9 @@ ALTER TABLE MyTable ADD (
PRIMARY KEY (id) NOT ENFORCED,
WATERMARK FOR ts AS ts - INTERVAL '3' SECOND
);
+
+-- add a new partition
+ALTER TABLE MyTable ADD PARTITION (p1=1,p2='a') with ('k1'='v1');
Review Comment:
Give an example for adding multiple partition?
##########
docs/content/docs/dev/table/sql/alter.md:
##########
@@ -298,9 +298,9 @@ Flink SQL> SHOW TABLES;
The following grammar gives an overview about the available syntax:
```text
ALTER TABLE [IF EXISTS] table_name {
- ADD { <schema_component> | (<schema_component> [, ...]) }
+ ADD { <schema_component> | (<schema_component> [, ...]) | [IF NOT EXISTS]
<partition_add_component> [, ...]}
Review Comment:
```suggestion
ADD { <schema_component> | (<schema_component> [, ...]) | [IF NOT
EXISTS] <partition_component> [, ...]}
```
##########
docs/content/docs/dev/table/sql/alter.md:
##########
@@ -380,7 +389,7 @@ ALTER TABLE MyTable MODIFY (
<span class="label label-danger">Note</span> Modify a column to be primary key
will change the column's nullability to false implicitly.
### DROP
-Use `DROP` clause to drop columns, primary key and watermark strategy to an
existing table.
+Use `DROP` clause to drop columns, primary key, partitions and watermark
strategy to an existing table.
Review Comment:
```suggestion
Use the `DROP` clause to drop columns, primary key, partitions, and
watermark strategy to an existing table.
```
##########
docs/content/docs/dev/table/sql/alter.md:
##########
@@ -330,14 +330,20 @@ ALTER TABLE [IF EXISTS] table_name {
<computed_column_definition>:
AS computed_column_expression
+
+<partition_component>:
+ PARTITION (key1=val1, key2=val2, ...)
Review Comment:
```suggestion
PARTITION (key1=val1, key2=val2, ...) [WITH (key1=val1, key2=val2, ...)]
```
##########
docs/content/docs/dev/table/sql/alter.md:
##########
@@ -394,6 +403,9 @@ ALTER TABLE MyTable DROP (col1, col2, col3);
-- drop primary key
ALTER TABLE MyTable DROP PRIMARY KEY;
+-- drop partitions
+ALTER TABLE MyTable DROP PARTITION (`id` = 1);
Review Comment:
Give an example for dropping multiple partitions?
##########
docs/content/docs/dev/table/sql/show.md:
##########
@@ -740,6 +741,65 @@ show columns from orders not like '%_r';
4 rows in set
```
+## SHOW PARTITIONS
+
+```sql
+SHOW PARTITIONS [[catalog_name.]database.]<table_name> [ PARTITION
<partition_spec>]
+
+<partition_spec>:
+ (key1=val1, key2=val2, ...)
+```
+
+Show all partitions of the partitioned table with given table name and
optional partition clause.
+
+**PARTITION**
+Show all partitions of the partitioned table with given table name and
optional `PARTITION` clause, which are under the provided <partition_spec>.
Review Comment:
```suggestion
Show all partitions of the partitioned table with the given table name and
optional `PARTITION` clause, which are under the provided <partition_spec>.
```
##########
docs/content/docs/dev/table/sql/show.md:
##########
@@ -740,6 +741,65 @@ show columns from orders not like '%_r';
4 rows in set
```
+## SHOW PARTITIONS
+
+```sql
+SHOW PARTITIONS [[catalog_name.]database.]<table_name> [ PARTITION
<partition_spec>]
+
+<partition_spec>:
+ (key1=val1, key2=val2, ...)
+```
+
+Show all partitions of the partitioned table with given table name and
optional partition clause.
Review Comment:
```suggestion
Show all partitions of the partitioned table with the given table name and
optional partition clause.
```
--
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]