wutiangan commented on a change in pull request #3898:
URL: https://github.com/apache/incubator-doris/pull/3898#discussion_r442791890



##########
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:
       StringParser::string_to_bool will consider "1" to false, is it ok?




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

Reply via email to