You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/12/31 08:26:21 UTC

[GitHub] [iceberg] hililiwei commented on a change in pull request #3823: Docs: Flink create table with primary key.(#3822)

hililiwei commented on a change in pull request #3823:
URL: https://github.com/apache/iceberg/pull/3823#discussion_r776950251



##########
File path: site/docs/flink.md
##########
@@ -301,7 +301,22 @@ Table create commands support the most commonly used [flink create clauses](http
 * `COMMENT 'table document'` to set a table description.
 * `WITH ('key'='value', ...)` to set [table configuration](./configuration.md) which will be stored in apache iceberg table properties.
 
-Currently, it does not support computed column, primary key and watermark definition etc.
+Currently, it does not support computed column and watermark definition etc.
+
+### `PRIMARY KEY`
+
+To declare primary key(s) in a table, use `PRIMARY KEY ... NOT ENFORCED`:
+
+```sql
+CREATE TABLE `hive_catalog`.`default`.`sample` (
+    id BIGINT COMMENT 'unique id',
+    data STRING,
+    PRIMARY KEY (id) NOT ENFORCED
+);
+```
+
+Flink only support declare primary key(s) in not enforced mode. 
+More information see in [flink create clauses](https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/sql/create.html#create-table).

Review comment:
       > ......Table create commands support the most commonly used [flink create clauses](https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/sql/create.html#create-table) now.....
   
   Is it repeated here?

##########
File path: site/docs/flink.md
##########
@@ -301,7 +301,22 @@ Table create commands support the most commonly used [flink create clauses](http
 * `COMMENT 'table document'` to set a table description.
 * `WITH ('key'='value', ...)` to set [table configuration](./configuration.md) which will be stored in apache iceberg table properties.
 
-Currently, it does not support computed column, primary key and watermark definition etc.
+Currently, it does not support computed column and watermark definition etc.
+
+### `PRIMARY KEY`
+
+To declare primary key(s) in a table, use `PRIMARY KEY ... NOT ENFORCED`:
+
+```sql
+CREATE TABLE `hive_catalog`.`default`.`sample` (
+    id BIGINT COMMENT 'unique id',
+    data STRING,
+    PRIMARY KEY (id) NOT ENFORCED

Review comment:
       is `id BIGINT PRIMARY KEY NOT ENFORCED COMMENT 'unique id',`  support?

##########
File path: site/docs/flink.md
##########
@@ -301,7 +301,22 @@ Table create commands support the most commonly used [flink create clauses](http
 * `COMMENT 'table document'` to set a table description.
 * `WITH ('key'='value', ...)` to set [table configuration](./configuration.md) which will be stored in apache iceberg table properties.
 
-Currently, it does not support computed column, primary key and watermark definition etc.
+Currently, it does not support computed column and watermark definition etc.
+
+### `PRIMARY KEY`

Review comment:
        Could you add  description of `PRIMARY KEY`, below line 300?
   




-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org