github-actions[bot] commented on code in PR #68448:
URL: https://github.com/apache/doris/pull/68448#discussion_r4090461794


##########
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:
   [P1] Preserve valid oversized JSON-number behavior
   
   This finite check rejects numbers such as `9.6E400`, which are syntactically 
valid JSON even though they exceed binary64, so the change is broader than 
rejecting malformed tokens. It already breaks the exact-head P0 run: `SELECT 
json_array_contains('[9.6E400]', 4.2)` now returns SQL `NULL` instead of the 
checked-in `false`. Please keep oversized-number compatibility separate from 
malformed-token validation (including the analogous big-integer fallback), or 
explicitly update the contract and all dependent expectations; as submitted, 
the required P0 suite is red.



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