Skip to content

Conversation

@wangxiaojing
Copy link

When using partitioned scan in Flink JDBC table, if scan.partition.lower-bound and scan.partition.upper-bound are very large, there could be a situation where one data record is lost. For example, maximum value: 3875220057236942850, minimum value: 2260418954055131340.

@boring-cyborg
Copy link

boring-cyborg bot commented Jul 4, 2025

Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html)

@wangxiaojing wangxiaojing changed the title Solve the issue of missing one piece of data [FLINK-38046][Connector/JDBC]Solve the issue of missing one piece of data Jul 4, 2025
@eskabetxe
Copy link
Member

Hi @wangxiaojing
thanks for your contribution..

could you add a test for this..

@wangxiaojing
Copy link
Author

No conflicts with base branch

Add test cases

@github-actions
Copy link

This PR is being marked as stale since it has not had any activity in the last 90 days.
If you would like to keep this PR alive, please leave a comment asking for a review.
If the PR has merge conflicts, update it with the latest from the base branch.

If you are having difficulty finding a reviewer, please reach out to the
community, contact details can be found here: https://flink.apache.org/what-is-flink/community/

If this PR is no longer valid or desired, please feel free to close it.
If no activity occurs in the next 30 days, it will be automatically closed.

@github-actions github-actions bot added the stale label Nov 29, 2025
Copy link
Contributor

@RocMarshal RocMarshal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch and Thanks @wangxiaojing for the contribution.

I left a few of comments, PTAL if you had the free time.

void testBatchMaxMinTooLarge() {
JdbcNumericBetweenParametersProvider provider =
new JdbcNumericBetweenParametersProvider(2260418954055131340L, 3875220057236942850L)
.ofBatchSize(3);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that we should call the ofBatchNum method here?

Comment on lines +125 to +129
long[][] expected = {
new long[] {2260418954055131340L, 2798685988449068510L},
new long[] {2798685988449068511L, 3336953022843005681L},
new long[] {3336953022843005682L, 3875220057236942850L}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
long[][] expected = {
new long[] {2260418954055131340L, 2798685988449068510L},
new long[] {2798685988449068511L, 3336953022843005681L},
new long[] {3336953022843005682L, 3875220057236942850L}
};
long[][] expected = {
new long[] {2260418954055131340L, 2798685988449068491L},
new long[] {2798685988449068492L, 3336953022843005643L},
new long[] {3336953022843005644L, 3875220057236942850L}
};
image

I tried to follow your train of thought to review this test case. Perhaps you were trying to convey this expected outcome. Please let me know your opinion.

@github-actions github-actions bot removed the stale label Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants