You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "HappenLee (via GitHub)" <gi...@apache.org> on 2023/04/13 03:10:08 UTC

[GitHub] [doris] HappenLee commented on a diff in pull request #18369: [Improvement](functions)Optimized some datetime function's return value

HappenLee commented on code in PR #18369:
URL: https://github.com/apache/doris/pull/18369#discussion_r1164933651


##########
be/src/vec/functions/function.h:
##########
@@ -300,12 +302,16 @@ class IFunctionBuilder {
 
 using FunctionBuilderPtr = std::shared_ptr<IFunctionBuilder>;
 
+/// used in function_factory. when we register a function, save a builder. to get a function, to get a builder.
+/// will use DefaultFunctionBuilder as the default builder in function's registration if we didn't explicitly specify.
 class FunctionBuilderImpl : public IFunctionBuilder {
 public:
-    FunctionBasePtr build(const ColumnsWithTypeAndName& arguments,
-                          const DataTypePtr& return_type) const final {
+    FunctionBasePtr build(const ColumnsWithTypeAndName& arguments, const DataTypePtr& return_type,
+                          const bool skip_type_check = false) const final {
         const DataTypePtr& func_return_type = get_return_type(arguments);
-        DCHECK(return_type->equals(*func_return_type) ||
+        // check return types equal.
+        DCHECK(skip_type_check /*iff we did function replacement in exec_version 2*/ ||

Review Comment:
   which case we should skip the type check ?



-- 
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-unsubscribe@doris.apache.org

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


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