thswlsqls commented on code in PR #10376:
URL: https://github.com/apache/paimon/pull/10376#discussion_r4277433517
##########
paimon-format/src/main/java/org/apache/paimon/format/json/JsonFileReader.java:
##########
@@ -64,12 +70,34 @@ public JsonFileReader(
throws IOException {
super(fileIO, filePath, rowType, options.getLineDelimiter(), offset,
length);
this.options = options;
+ // Parse floating-point numbers as BigDecimal only when needed, so
DECIMAL values keep
+ // their precision instead of being rounded through double.
+ this.jsonReader =
+ containsDecimal(rowType)
+ ? JsonSerdeUtil.OBJECT_MAPPER_INSTANCE
+ .reader()
+
.with(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS)
Review Comment:
@JingsongLi Thanks for the review.
Understood on leaving signed zero out of scope. The observation itself
holds: with `USE_BIG_DECIMAL_FOR_FLOATS`, `-0.0` becomes an unsigned
`BigDecimal` zero for non-DECIMAL fields. If you want that handled later, I can
follow up with per-field parsing in a separate 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]