thswlsqls opened a new issue, #10374:
URL: https://github.com/apache/paimon/issues/10374

   **Search before asking**
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   **Paimon version**
   master @ b0af45681
   
   **Compute Engine**
   Engine-agnostic (format). Reached from Flink and Spark JSON format tables.
   
   **Minimal reproduce step**
   Create a JSON format table with a `DECIMAL(20,2)` column, write a file with 
an external writer containing the line `{"d":12345678901234567.89}`, and read 
it.
   
   `JsonFileReader.parseLine()` (`paimon-format/.../json/JsonFileReader.java` 
line 72) calls `readTree` on the default mapper, so the number is parsed as a 
double before it is cast to DECIMAL.
   
   **What doesn't meet your expectations?**
   Expected `12345678901234567.89`; actual `12345678901234568.00`. A 
`DECIMAL(38,18)` value `123456789.123456789` also loses its last digits. 
`fileformat.md` maps `DECIMAL` to a JSON `number`, so numeric literals are 
valid input.
   
   **Anything else?**
   Existing round-trip tests miss this because `JsonFormatWriter` writes 
DECIMAL as a JSON string, which never takes the double path.
   
   **Are you willing to submit a PR?**
   - [x] I'm willing to submit a PR!
   


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