yangzhg commented on a change in pull request #3898: URL: https://github.com/apache/incubator-doris/pull/3898#discussion_r442160830
########## File path: be/src/exprs/cast_functions.cpp ########## @@ -229,6 +229,17 @@ StringVal CastFunctions::cast_to_string_val(FunctionContext* ctx, const StringVa return sv; } +BooleanVal CastFunctions::cast_to_boolean_val(FunctionContext* ctx, const StringVal& val) { + if (val.is_null) return BooleanVal::null(); + StringParser::ParseResult result; + BooleanVal ret; + ret.val = StringParser::string_to_bool(reinterpret_cast<char*>(val.ptr), val.len, &result); + if (UNLIKELY(result != StringParser::PARSE_SUCCESS || std::isnan(ret.val) || std::isinf(ret.val))) { + return BooleanVal::null(); + } Review comment: Please review it again @chaoyli ---------------------------------------------------------------- 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