ASDFSA13 commented on PR #8467:
URL: https://github.com/apache/seatunnel/pull/8467#issuecomment-3721589334
这个pr有问题, 其实还是没解决
对于mysql8.0.28版本的数据库
PRIMARY KEY (`id`),
UNIQUE KEY `uni_str` (`str_value_sha256`,`seq`,`ledger_date`,`is_delete`)
USING BTREE,
KEY `idx_status` (`seller_id`,`market_place_id`,`is_delete`) USING BTREE,
KEY `idx_created_time` (`create_time`) USING BTREE,
KEY `idx_ledger_date` (`ledger_date`,`event_type`,`sync_status`) USING
BTREE
表结构如上,这时候代码,对于表结构如果主键id为 PRIMARY KEY 的时候, 他是只会从 UNIQUE KEY 取字段生效, 而不从
PRIMARY KEY 取字段生效
String tableSc = splitColumnsConfig.getOrDefault(tableId.catalog() + "." +
tableId.table(), null);
if (StringUtils.isNotEmpty(tableSc)) {
AtomicBoolean isUniqueKey = new AtomicBoolean(false);
dialect.getUniqueKeys(jdbc, tableId).forEach(ck ->
ck.getColumnNames().forEach(ckc -> {
if (tableSc.equals(ckc.getColumnName())) {
isUniqueKey.set(true);
}
}));
if (isUniqueKey.get()) { return column; }
else { log.warn("Config snapshotSplitColumn not unique key for table
{}", tableId); }
}
--
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]