dybyte commented on code in PR #11101:
URL: https://github.com/apache/seatunnel/pull/11101#discussion_r3489733545


##########
docs/en/connectors/sink/Jdbc.md:
##########
@@ -230,6 +231,42 @@ When data_save_mode selects CUSTOM_PROCESSING, you should 
fill in the CUSTOM_SQL
 
 Note: in sink `query` mode, `custom_sql` is not executed. This behavior is a 
current limitation of JDBC sink.
 
+### table_options [Map]
+
+Sink-specific table options applied when SaveMode creates the target table 
(DDL phase). They take effect only when `schema_save_mode` triggers table 
creation, such as `CREATE_SCHEMA_WHEN_NOT_EXIST` or `RECREATE_SCHEMA`. They do 
**not** affect INSERT/UPSERT at runtime and do **not** run `ALTER TABLE` on 
existing tables.
+
+Current support:
+
+| Dialect | Supported | Allowed keys |
+|---------|-----------|--------------|
+| MySQL / TiDB | Yes | `engine`, `charset`, `collate` |

Review Comment:
   The docs currently list “MySQL / TiDB” as supported, but the implementation 
only updates `MysqlDialect` and the tests cover MySQL only. I suggest changing 
this to “MySQL” or “MySQL dialect path”, unless we add a TiDB-specific 
test/clarification.



##########
docs/zh/connectors/sink/Jdbc.md:
##########
@@ -218,6 +219,42 @@ Sink插件常用参数,请参考 [Sink常用选项](../common-options/sink-com
 `CUSTOM_PROCESSING`:允许用户自定义数据处理方式<br/>
 `ERROR_WHEN_DATA_EXISTS`:当有数据时抛出错误<br/>
 
+### table_options [Map]
+
+Sink 在自动建表(SaveMode DDL)时附加的表级选项。仅在 `schema_save_mode` 触发建表时生效,例如 
`CREATE_SCHEMA_WHEN_NOT_EXIST`、`RECREATE_SCHEMA`;**不影响**数据写入阶段的 
INSERT/UPSERT,也**不会**对已存在表执行 `ALTER TABLE`。
+
+当前支持情况:
+
+| 方言 | 是否支持 | 可用 key |
+|------|----------|----------|
+| MySQL / TiDB | 是 | `engine`、`charset`、`collate` |

Review Comment:
   ditto



##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/options/SinkConnectorCommonOptions.java:
##########
@@ -29,4 +32,12 @@ public class SinkConnectorCommonOptions extends 
ConnectorCommonOptions {
                     .intType()
                     .defaultValue(1)
                     .withDescription("The replica number of multi table sink 
writer");
+
+    @Experimental
+    public static Option<Map<String, String>> TABLE_OPTIONS =
+            Options.key("table_options")
+                    .mapType()
+                    .defaultValue(new HashMap<>())
+                    .withDescription(
+                            "Sink-specific table options applied when 
auto-creating target tables.");

Review Comment:
   Could we make the option description more explicit about the current support 
boundary? Since this PR only implements the JDBC MySQL dialect path, 
`table_options` should be described as experimental and 
connector/dialect-specific. Otherwise, users may assume it is supported by all 
sinks that auto-create tables.



-- 
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]

Reply via email to