Search before asking
Paimon version
master @ b0af456
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?
Search before asking
Paimon version
master @ b0af456
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.javaline 72) callsreadTreeon 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; actual12345678901234568.00. ADECIMAL(38,18)value123456789.123456789also loses its last digits.fileformat.mdmapsDECIMALto a JSONnumber, so numeric literals are valid input.Anything else?
Existing round-trip tests miss this because
JsonFormatWriterwrites DECIMAL as a JSON string, which never takes the double path.Are you willing to submit a PR?