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

   ### 现象
   
   两个连接器里各有一组「已声明但从未生效」的配置项,文档里也没有它们——用户照文档配不了,配了也不生效。
   
   ### 1. `connector-sls`:`log_group_size`
   
   `SlsSinkOptions.java:37-41`
   
   ```java
   public static final Option<Integer> LOG_GROUP_SIZE =
           Options.key("log_group_size")
                   .intType()
                   .defaultValue(100)
                   .withDescription("Aliyun sls log group write size");
   ```
   
   `SlsSinkWriter.java` 只在构造函数里读进字段,之后再没被引用:
   
   ```
   $ grep -rn "logGroupSize" seatunnel-connectors-v2/connector-sls/src/main/java
   SlsSinkWriter.java:47:    private final Integer logGroupSize;
   SlsSinkWriter.java:67:        this.logGroupSize = 
pluginConfig.get(SlsSinkOptions.LOG_GROUP_SIZE);
   ```
   
   而 `write()` 是「一行一次 PutLogs」:
   
   ```java
   public void write(SeaTunnelRow element) throws IOException {
       List<LogItem> data = 
this.seatunnelRowSerialization.serializeRow(element);
       PutLogsRequest plr = new PutLogsRequest(project, logStore, topic, 
source, data);
       this.client.PutLogs(plr);
       ...
   }
   ```
   
   所以默认值 100 从未参与任何分批。同时 `docs/{en,zh}/connectors/sink/Sls.md` 的选项表里没有这一项。
   
   ### 2. `connector-sensorsdata`:`target_columns` / `json_column_name`
   
   `format/config/SensorsDataOptions.java:87` 与 `:111` 声明了这两项(后者默认 
`json_content`),但整个仓库里除定义处外没有任何引用:
   
   ```
   $ grep -rn "TARGET_COLUMNS\|JSON_COLUMN_NAME" --include=*.java .
   SensorsDataOptions.java:87  (定义)
   SensorsDataOptions.java:111 (定义)
   TargetColumnConfig.java:51,52 (自己读自己)
   ```
   
   `SensorsDataBaseOptionRules` 里也没有把它们加进 option 
rule,`docs/{en,zh}/connectors/sink/SensorsData.md` 同样没有这两项。同一目录下的 
`TargetColumnConfig.of(...)` 也没有调用方。
   
   ### 期望
   
   两种方向都行,看你们偏好:
   
   1. **实现它**:`log_group_size` 用于按条数聚合 log group 再批量 PutLogs(这也是它的描述所暗示的)。
   2. **删掉它**:把从未生效的 option 与死代码移除,避免用户以为配了有用。
   
   对 `target_columns` / `json_column_name`,如果 `format/config` 
是历史残留,倾向直接删除;若是给后续 transform 预留,建议至少加进 option rule 并在文档里说明。
   
   ### 说明
   
   我没有直接开 PR:删除公共配置项属于兼容性问题,而实现批量写入需要改 `write()` 的行为并跑真实 SLS 
校验,这两者都该由维护者先定方向。定了方向我可以提 PR。
   


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