yangzhg commented on a change in pull request #3898: URL: https://github.com/apache/incubator-doris/pull/3898#discussion_r442160165
########## File path: be/src/olap/utils.cpp ########## @@ -1264,6 +1265,15 @@ bool valid_datetime(const string &value_str) { } } +bool valid_bool(const std::string& value_str) { + if (value_str == "0" || value_str == "1") { + return true; + } + StringParser::ParseResult result; + StringParser::string_to_bool(value_str.c_str(), value_str.length(), &result); Review comment: "Truetest" won't be converted to `true` because of `is_all_whitespace()`, it will return `PARSE_FAILURE`. In additional, this is just test the string is `true` or `false` ignore case; ---------------------------------------------------------------- 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. 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