ic4y commented on code in PR #5384:
URL: https://github.com/apache/seatunnel/pull/5384#discussion_r1312777964
##########
seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/splitter/AbstractJdbcSourceChunkSplitter.java:
##########
@@ -356,16 +357,23 @@ protected Column getSplitColumn(
JdbcConnection jdbc, JdbcDataSourceDialect dialect, TableId
tableId)
throws SQLException {
Optional<PrimaryKey> primaryKey = dialect.getPrimaryKey(jdbc, tableId);
+ Column splitColumn = null;
if (primaryKey.isPresent()) {
List<String> pkColumns = primaryKey.get().getColumnNames();
Table table = dialect.queryTableSchema(jdbc, tableId).getTable();
for (String pkColumn : pkColumns) {
Column column = table.columnWithName(pkColumn);
if (isEvenlySplitColumn(column)) {
- return column;
+ splitColumn = columnComparable(splitColumn, column);
+ if (sqlTypePriority(splitColumn) == 1) {
+ return splitColumn;
+ }
}
}
+ if (splitColumn != null) {
+ return splitColumn;
+ }
Review Comment:
Remove this, would it be better to also include Unique Keys in the
comparison?
--
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]