bitifi2019 opened a new issue, #11802:
URL: https://github.com/apache/seatunnel/issues/11802

   环境信息
   SeaTunnel 版本:2.3.18
   Doris版本: 3.x
   Doris Connector 版本:connector-doris-2.3.18.jar
   部署方式:集群模式(Master/Worker)
   JDK 版本:1.8
   
   问题描述
   在使用 Doris Sink 进行多表同步时,需要实现“覆盖写入”(即每次任务启动前先清空目标表,再写入数据),以保证同步的幂等性。
   在单表同步时,我可以通过以下配置实现:
   
   hocon
   Doris {
       ...
       data_save_mode = "CUSTOM_PROCESSING"
       custom_sql = "TRUNCATE TABLE test.table1"
       sink.enable-delete = "true"
   }
   该配置能在每个 Stream Load 批次前执行指定的 TRUNCATE 语句,清空目标表,效果正常。
   
   但在多表同步场景中(例如使用 table_list 或通配符匹配多张表),custom_sql 是静态字符串,无法根据当前写入的表名动态生成对应的 
TRUNCATE 语句。即使配置了 data_save_mode = "CUSTOM_PROCESSING",custom_sql 也只会执行固定的一条 
SQL,导致其他表的数据无法被清理,旧数据残留。
   
   已尝试方案
   1.在 data_save_mode = "DROP_DATA"时 ,日志显示 DataSaveMode 仍为 
APPEND_DATA,可能该参数未正确生效。请问data_save_mode = "DROP_DATA",是否需要什么参数配置才能生效。
   
   2.在schema_save_mode = RECREATE_SCHEMA 时,并没有drop ... create , 而是执行create if 
not exists table1, 此能否实现先drop table 然后再create if not exists, 或者说是否需要什么参数配置才能生效。


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