hutiefang76 opened a new pull request, #12584:
URL: https://github.com/apache/seatunnel/pull/12584
### Purpose of this pull request
Fixes #12583. With 2001 integer keys and 1000 fixed partitions, rounded
widths drop the last key. The remainder calculation can also extend intervals
beyond the upper bound, and a full BIGINT span overflows the long width.
Compute widths with exact BigDecimal ceiling division and distribute the
remainder within the original bounds. By-size requests keep their maximum batch
width and clamp the final interval; non-terminating division no longer aborts
them.
### Does this PR introduce _any_ user-facing change?
Yes. Fixed integer query partitions preserve all keys within the lower/upper
bounds, without overlap or out-of-range reads. Valid BIGINT and zero-scale
DECIMAL widths no longer narrow to long. Public signatures and configuration
defaults remain the same. English and Chinese JDBC docs describe the fixed
integer range behavior. This does not redesign dynamic or floating-point
splitting.
### How was this patch tested?
On the original code, real DuckDB split queries miss id=2001, include an
out-of-range id=11, and fail on the full signed BIGINT span. Provider
regressions also reproduce non-terminating division and DECIMAL-width failure.
The existing JdbcMysqlSplitIT new case fails on the original provider with 2001
vs 2000 rows and passes with the fix on MySQL 8.0.43.
JDK 8 and 17: 30 affected/neighbor connector tests and 4 MarkdownTest checks
each, no failures/errors/skips. This includes exact by-size bounds,
singleton/negative ranges, high partition count, full BIGINT and DECIMAL38
bounds, invalid inputs, fractional-clamp compatibility, mode replacement, and
overflow leaving the previous configuration intact. Three query regressions
extend the existing FixedChunkSplitterTest and execute actual DuckDB SQL. The
existing MySQL IT calls generateSplits and executes every prepared query,
checking uniqueness and both bounds. One MySQL IT is run on JDK 17; no full
engine or connector-suite claim.
Scoped Spotless, reactor `-DskipTests verify`, and `git diff --check` pass.
No new dependency or option. Infeasible by-size requests requiring more than
Integer.MAX_VALUE batches fail rather than silently narrowing the array count.
### Check list
* [ ] If any new Jar binary package adding in your PR, please add License
Notice according
[New License
Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/developer/new-license.md)
* [ ] If necessary, please update the documentation to describe the new
feature. https://github.com/apache/seatunnel/tree/dev/docs
* [ ] If necessary, please update `incompatible-changes.md` to describe the
incompatibility caused by this PR.
* [ ] If you are contributing the connector code, please check that the
following files are updated:
1. Update
[plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties)
and add new connector information in it
2. Update the pom file of
[seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
3. Add ci label in
[label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
4. Add e2e testcase in
[seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
5. Update connector
[plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)
--
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]