sandynz commented on code in PR #20111:
URL: https://github.com/apache/shardingsphere/pull/20111#discussion_r944264995
##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ingest/dumper/AbstractInventoryDumper.java:
##########
@@ -169,7 +171,7 @@ private Optional<Object> dump0(final Connection conn, final
String sql, final in
for (int i = 1; i <= metaData.getColumnCount(); i++) {
boolean isUniqueKey = tableMetaData.isUniqueKey(i - 1);
Object value = readValue(resultSet, i);
- if (isUniqueKey) {
+ if
(Objects.equals(tableMetaData.getColumnMetaData(uniqueKey).getName(),
metaData.getColumnName(i))) {
maxUniqueKeyValue = value;
}
Review Comment:
Could we get column index outside of for loop and while loop? Then it'll
have better performance.
And it's better to put the column name and index translation in
PipelineTableMetaData.
--
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]