LuciferYang opened a new pull request, #10220:
URL: https://github.com/apache/paimon/pull/10220

   ### Purpose
   
   `FieldProductAgg`'s retract path divided decimals with a bare 
`BigDecimal.divide`, which throws `ArithmeticException` ("Non-terminating 
decimal expansion") for any quotient that does not terminate at the divisor 
scale, for example 1 / 3. A retract row into an aggregation table with a 
decimal product column then kills the write or compaction job.
   
   This divides at the column scale with `RoundingMode.HALF_UP`, the same 
rounding `fromBigDecimal` already applies on the line below, so the quotient 
rounds like every other decimal conversion instead of throwing, and retract 
stays consistent with how the forward agg path rounds its product.
   
   ### Tests
   
   Added a case in `FieldAggregatorTest` that retracts 3 out of a 
`DECIMAL(10,4)` product column holding 1 and asserts the result is 0.3333, 
pinning that a non-terminating quotient now rounds at the column scale instead 
of throwing.
   
   ### API and Format
   
   No.
   
   ### Documentation
   
   No.
   


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