amorynan commented on code in PR #22364:
URL: https://github.com/apache/doris/pull/22364#discussion_r1280045981


##########
be/src/util/string_parser.hpp:
##########
@@ -624,27 +624,29 @@ T StringParser::string_to_decimal(const char* s, int len, 
int type_precision, in
     }
 
     int precision = 0;
+    int max_digit = type_precision - type_scale;
     bool found_exponent = false;
     int8_t exponent = 0;
     T value = 0;
     for (int i = 0; i < len; ++i) {
         const char& c = s[i];
-        if (LIKELY('0' <= c && c <= '9')) {
+        if (found_dot && max_digit < (precision - scale)) {

Review Comment:
   make sense!



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to