hutiefang76 opened a new issue, #12583:
URL: https://github.com/apache/seatunnel/issues/12583

   ### Search before asking
   
   - [x] I searched existing issues and pull requests for this numeric 
fixed-split problem.
   
   ### What happened
   
   The fixed numeric splitter can omit rows or exceed its configured bounds:
   
   - With integer ids 1..2001 and partition_num=1000, the range width is 
rounded twice to 2; queries read 2000 rows and miss id=2001.
   - With bounds 1..10 and partition_num=3, the incorrect remainder calculation 
creates an interval ending at 12; a row with id=11 is read.
   - With the full signed BIGINT bounds and two partitions, the calculated 
width exceeds Long.MAX_VALUE and narrows to a negative long; split generation 
fails.
   
   The parameter provider's by-size API also throws ArithmeticException for 
1..1000 with batch size 300 because it performs exact division without rounding.
   
   Expected: fixed integer intervals cover the chosen bounds exactly once, 
support valid BIGINT/zero-scale DECIMAL widths and never extend past the upper 
bound. This report concerns the fixed query mode, not dynamic table_path 
splitting or floating-point range semantics.
   
   ### SeaTunnel Version
   
   Current dev at `4c4fd615d677695b619ca0e04fcfd82e104cd4a9`.
   
   ### SeaTunnel Config
   
   Populate a JDBC table `t(id BIGINT PRIMARY KEY)` with ids 1..2001. Configure 
the top-level JDBC Source with:
   
   ```hocon
   query = "SELECT id FROM t"
   partition_column = "id"
   partition_lower_bound = 1
   partition_upper_bound = 2001
   partition_num = 1000
   ```
   
   Use the usual JDBC URL, driver and credentials for the test database. For 
the bounds case, populate ids 0..11 and change the lower/upper/count to 1/10/3.
   
   ### Running Command
   
   Run the batch job with an Assert sink expecting the configured row count, or 
execute and aggregate the FixedChunkSplitter-generated PreparedStatements 
against the test table.
   
   ### Error Exception
   
   The row-count regression reports `expected: 2001 but was: 2000`. Full BIGINT 
splitting reports `IllegalStateException: Batch size and batch number must be 
positive`. The by-size API reports `ArithmeticException: Non-terminating 
decimal expansion`.
   
   ### Java or Scala Version
   
   Reproduced with JDK 8 and 17, real DuckDB JDBC queries; the omitted-row case 
is also checked against MySQL 8.0.43.
   
   ### Are you willing to submit PR?
   
   - [x] Yes
   
   ### Code of Conduct
   
   - [x] I agree to follow the project Code of Conduct.
   


-- 
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]

Reply via email to