Wan95u commented on issue #10365:
URL: https://github.com/apache/seatunnel/issues/10365#issuecomment-3767448384

   > 感谢你举报。我已经确认这个bug存在于Excel连接器里。
   > 
   > 
**根源**:错误地使用Excel的原始字段索引作为列号,而非顺序列位置(0,1,2,3......)。例如,如果映射到索引,Excel会将列写在0,12,2,3,4的位置,而不是0,1,2,3,4。`ExcelGenerator.java``sinkColumnsIndexInRow``sink_columns``[0,12,2,3,4...]`
   > 
   > **受影响代码**:
   > 
   > * 
`seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/util/ExcelGenerator.java`(第76-80行,97-100行,120-121行)
   > 
   > 当 时,这会影响所有基于文件的接收器(SFTP/HDFS/本地/OSS)。其他格式(CSV/JSON/ORC)通过 
正确重排列。`file_format_type=excel``seaTunnelRow.copy()`
   > 
   > **建议的解决**办法:在头部和数据写入循环中都替换为 。在 中加入带有非顺序索引的测试用例(例如 
)。`createCell(i)``createCell(colIndex++)``[3,0,2]``ExcelGeneratorTest.java`
   > 
   > **变通**方法:使用CSV格式作为输出,这样可以正确处理列的排序。
   
   


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