JingsongLi opened a new pull request, #1118:
URL: https://github.com/apache/paimon-rust/pull/1118

   ## Summary
   
   Align the decimal schema-evolution conversions already supported by PyPaimon 
with Java `CastExecutors`:
   
   - Convert FLOAT/DOUBLE through Java decimal text before HALF_UP rounding. 
FLOAT first widens to DOUBLE, matching `Number.doubleValue()` and 
`BigDecimal.valueOf`.
   - Parse CHAR/VARCHAR decimal text, including scientific notation. Native 
currently silently converts valid `"1e-2"` to NULL and rounds DOUBLE `1.005` to 
`1.00` rather than Java's `0.01` and `1.01` respectively.
   - Check precision after rounding and return NULL on numeric overflow. 
Invalid decimal text and unsupported Java scale ranges remain errors.
   - Apply the conversion at every schema-evolution leaf, including ROW, ARRAY 
and MAP values.
   - Extract the existing Java floating-point formatter into a shared internal 
utility used by partition paths and decimal conversions.
   
   The implementation is in Rust core and is consumed by the existing Python 
read binding.
   
   ## Verification
   
   - New baseline regressions: all five original decimal unit tests failed 
before the fix.
   - Final decimal unit tests: 6 passed.
   - Arrow unit tests: 543 passed, 1 ignored.
   - Partition formatting unit tests: 39 passed.
   - Decimal and existing schema-evolution integration tests: 3 passed, 
exercising append, PK and data evolution, mixed old/new files, single-value 
stats, hidden predicate columns and overflow NULLs.
   - PyPaimon REST end-to-end tests against a locally rebuilt binding: 38 
passed, with 89 Native plans/reads and 62 Native writes/commits. Includes 
nested containers and leaf projections.
   - Independent Java comparison: 2,025 ASCII decimal inputs and 11 bounded 
extreme-exponent inputs matched Java 21.
   - `cargo +1.98.0 fmt --all -- --check` and `cargo +1.98.0 clippy -p paimon 
--all-targets -- -D warnings` passed.
   


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