ASDFSA13 commented on PR #7840: URL: https://github.com/apache/seatunnel/pull/7840#issuecomment-3721777655
核心逻辑是: 先看用户配置的 snapshotSplitColumn 但它会先判断:配置列是否属于 dialect.getUniqueKeys() 返回的 unique keys 如果不在 unique keys 里,就直接 warn 并忽略配置 然后进入自动选择: 先遍历 PrimaryKey 列(id) 再遍历 UniqueKey 列(seq 等) 最终按类型优先级挑最“优”的一个:TINYINT > SMALLINT > INT > BIGINT > ... 这就解释了整个现象链: 我的 snapshotSplitColumn=id 被判定 “not unique key” 进入自动选择后: id 是 BIGINT seq 是 INT 类型优先级 INT(3) < BIGINT(4),于是最终选中 seq 即便主键是 id,最后仍然用 seq 分片。 以为“配置强制生效”,但实际上被静默忽略,只能从日志里看出来;并且再加上官方的mysqlcdc文档, 都不知道如何下手去调整(因为已经按照文档去设置了指定的分片键了) -- 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]
