mrhhsg commented on code in PR #68448:
URL: https://github.com/apache/doris/pull/68448#discussion_r4091298929


##########
be/src/util/jsonb_parser_simd.h:
##########
@@ -224,6 +311,54 @@ struct JsonbParser {
         return Status::OK();
     }
 
+    static Status write_floating_number(double number, std::string_view 
raw_string,
+                                        JsonbWriter& writer) {
+        // When a double exceeds the precision that can be represented by a 
double type in
+        // simdjson, it gets converted to 0. The correct approach is to 
truncate the value instead.
+        if (number == 0) {
+            StringParser::ParseResult result;
+            number = StringParser::string_to_float<double>(raw_string.data(), 
raw_string.size(),
+                                                           &result);
+            if (result != StringParser::PARSE_SUCCESS) {
+                return Status::InvalidArgument("invalid number, raw string is: 
" +
+                                               std::string(raw_string));
+            }
+        }
+        if (!std::isfinite(number)) {

Review Comment:
   Fixed in c43ed468cf8. The finite checks were removed from both the 
floating-point and oversized-integer fallbacks, so syntactically valid values 
such as `9.6E400`, `1e9999`, and integers beyond int128 retain the existing 
fallback behavior. Added focused positive unit coverage, while malformed number 
and trailing-document cases remain rejected.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to