eskabetxe commented on code in PR #244:
URL:
https://github.com/apache/flink-connector-jdbc/pull/244#discussion_r4138206137
##########
flink-connector-jdbc-core/src/main/java/org/apache/flink/connector/jdbc/core/datastream/source/enumerator/splitter/PreparedSplitterNumericParameters.java:
##########
@@ -77,11 +78,14 @@ public Serializable[][] getParameterValues() {
Serializable[][] parameters = new Serializable[batchNum][2];
long start = minVal;
- for (int i = 0; i < batchNum; i++) {
+ for (int i = 0; i < batchNum - 1; i++) {
long end = start + batchSize - 1 - (i >= bigBatchNum ? 1 : 0);
parameters[i] = new Long[] {start, end};
start = end + 1;
}
+ // bigBatchNum is negative when batchSize does not divide the range,
and the loop
Review Comment:
the comment explains the old bug instead of the current invariant; suggest
rewording to e.g. // the last split always ends exactly at maxVal.
--
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]