luoyuxia commented on code in PR #23116: URL: https://github.com/apache/flink/pull/23116#discussion_r1283096835
########## docs/content/docs/dev/table/sql/create.md: ########## @@ -554,7 +554,14 @@ INSERT INTO my_ctas_table SELECT id, name, age FROM source_table WHERE mod(id, 1 * Does not support creating partitioned table yet. * Does not support specifying primary key constraints yet. -**Note** The target table created by CTAS is non-atomic currently, the table won't be dropped automatically if occur errors while inserting data into the table. +**Note** By default, the target table created by CTAS is non-atomic, the table won't be dropped automatically if occur errors while inserting data into the table. + +#### Atomicity + +If you want to implement atomicity CTAS, then you need to fulfill the following conditions at the same time: Review Comment: Implementment shouldn't be in here as it's doc for users not for devs. ```suggestion If you want to enable atomicity for CTAS, then you shoud make sure: ``` ########## docs/content.zh/docs/dev/table/sql/create.md: ########## @@ -554,7 +554,14 @@ INSERT INTO my_ctas_table SELECT id, name, age FROM source_table WHERE mod(id, 1 * 暂不支持创建分区表。 * 暂不支持主键约束。 -**注意** 目前,CTAS 创建的目标表是非原子性的,如果在向表中插入数据时发生错误,该表不会被自动删除。 +**注意** 默认情况下,CTAS 创建的目标表是非原子性的,如果在向表中插入数据时发生错误,该表不会被自动删除。 Review Comment: The comments for en doc is also suitable for the zh doc. ########## docs/content/docs/dev/table/sql/create.md: ########## @@ -609,6 +616,15 @@ INSERT INTO my_rtas_table SELECT id, name, age FROM source_table WHERE mod(id, 1 * Does not support creating partitioned table yet. * Does not support specifying primary key constraints yet. +**Note** By default, the target table replaced or created by RTAS is non-atomic, the table won't be dropped or restore to origin automatically if occur errors while inserting data into the table. + +### Atomicity + +If you want to implement atomicity RTAS, then you need to fulfill the following conditions at the same time: Review Comment: dito. ########## docs/content/docs/dev/table/sql/create.md: ########## @@ -554,7 +554,14 @@ INSERT INTO my_ctas_table SELECT id, name, age FROM source_table WHERE mod(id, 1 * Does not support creating partitioned table yet. * Does not support specifying primary key constraints yet. -**Note** The target table created by CTAS is non-atomic currently, the table won't be dropped automatically if occur errors while inserting data into the table. +**Note** By default, the target table created by CTAS is non-atomic, the table won't be dropped automatically if occur errors while inserting data into the table. Review Comment: ```suggestion **Note** By default, CTAS is non-atomic which means the table created won't be dropped automatically if occur errors while inserting data into the table. ``` ########## docs/content/docs/dev/table/sql/create.md: ########## @@ -554,7 +554,14 @@ INSERT INTO my_ctas_table SELECT id, name, age FROM source_table WHERE mod(id, 1 * Does not support creating partitioned table yet. * Does not support specifying primary key constraints yet. -**Note** The target table created by CTAS is non-atomic currently, the table won't be dropped automatically if occur errors while inserting data into the table. +**Note** By default, the target table created by CTAS is non-atomic, the table won't be dropped automatically if occur errors while inserting data into the table. + +#### Atomicity + +If you want to implement atomicity CTAS, then you need to fulfill the following conditions at the same time: +* Set option `table.rtas-ctas.atomicity-enabled` to `true`. +* `DynamicTableSink` implements the `SupportsStaging` interface. Review Comment: Then remove these two lines. ########## docs/content/docs/dev/table/sql/create.md: ########## @@ -554,7 +554,14 @@ INSERT INTO my_ctas_table SELECT id, name, age FROM source_table WHERE mod(id, 1 * Does not support creating partitioned table yet. * Does not support specifying primary key constraints yet. -**Note** The target table created by CTAS is non-atomic currently, the table won't be dropped automatically if occur errors while inserting data into the table. +**Note** By default, the target table created by CTAS is non-atomic, the table won't be dropped automatically if occur errors while inserting data into the table. + +#### Atomicity + +If you want to implement atomicity CTAS, then you need to fulfill the following conditions at the same time: +* Set option `table.rtas-ctas.atomicity-enabled` to `true`. Review Comment: Please make the following content be the first point: ``` * The sink has implemented the atomicity semantics for CTAS. You may refer to the corresponding doc for the sink to know the atomicity semantics is available or not. For devs who want to implement the atomicity semantics, please refer to doc [SupportsStaging](link). ``` Then add a part for the interface `SupportsStaging` in doc table/sourcessinks/#sink-abilities just like other sink abilities. ########## docs/content/docs/dev/table/sql/create.md: ########## @@ -609,6 +616,15 @@ INSERT INTO my_rtas_table SELECT id, name, age FROM source_table WHERE mod(id, 1 * Does not support creating partitioned table yet. * Does not support specifying primary key constraints yet. +**Note** By default, the target table replaced or created by RTAS is non-atomic, the table won't be dropped or restore to origin automatically if occur errors while inserting data into the table. Review Comment: ```suggestion **Note** By default, RTAS is non-atomic which means the table won't be dropped or restored to its origin automatically if occur errors while inserting data into the table. ``` -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org