yangzhg commented on a change in pull request #3898:
URL: https://github.com/apache/incubator-doris/pull/3898#discussion_r442805904
##########
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);
Review comment:
"1" will convert to int not bool
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]