This is an automated email from the ASF dual-hosted git repository.

panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 627c855aa50 [Chore](function) remove DefaultExecutable (#55724)
627c855aa50 is described below

commit 627c855aa50b4e48e98f00655b10aee8c6ddaad7
Author: Pxl <[email protected]>
AuthorDate: Mon Sep 8 17:32:45 2025 +0800

    [Chore](function) remove DefaultExecutable (#55724)
    
    <img width="2418" height="908" alt="QQ_1757067730135"
    
src="https://github.com/user-attachments/assets/9767cda5-d83b-42c8-b589-03f18dfb756f";
    />
---
 be/src/vec/core/column_with_type_and_name.cpp |  8 +++--
 be/src/vec/data_types/data_type.cpp           |  1 -
 be/src/vec/functions/function.h               | 52 ++-------------------------
 3 files changed, 8 insertions(+), 53 deletions(-)

diff --git a/be/src/vec/core/column_with_type_and_name.cpp 
b/be/src/vec/core/column_with_type_and_name.cpp
index 7d83e8d3935..187c1982b79 100644
--- a/be/src/vec/core/column_with_type_and_name.cpp
+++ b/be/src/vec/core/column_with_type_and_name.cpp
@@ -93,12 +93,16 @@ void ColumnWithTypeAndName::to_pb_column_meta(PColumnMeta* 
col_meta) const {
 
 ColumnWithTypeAndName ColumnWithTypeAndName::get_nested(bool 
replace_null_data_to_default) const {
     if (type->is_nullable()) {
-        auto nested_type = assert_cast<const 
DataTypeNullable*>(type.get())->get_nested_type();
+        auto nested_type =
+                assert_cast<const DataTypeNullable*, 
TypeCheckOnRelease::DISABLE>(type.get())
+                        ->get_nested_type();
         ColumnPtr nested_column = column;
         if (column) {
             // A column_ptr is needed here to ensure that the column in 
convert_to_full_column_if_const is not released.
             auto column_ptr = nested_column->convert_to_full_column_if_const();
-            const auto* source_column = assert_cast<const 
ColumnNullable*>(column_ptr.get());
+            const auto* source_column =
+                    assert_cast<const ColumnNullable*, 
TypeCheckOnRelease::DISABLE>(
+                            column_ptr.get());
             nested_column = source_column->get_nested_column_ptr();
 
             if (replace_null_data_to_default) {
diff --git a/be/src/vec/data_types/data_type.cpp 
b/be/src/vec/data_types/data_type.cpp
index 4b90d6d0434..ccc41219d5b 100644
--- a/be/src/vec/data_types/data_type.cpp
+++ b/be/src/vec/data_types/data_type.cpp
@@ -56,7 +56,6 @@ String IDataType::do_get_name() const {
 
 ColumnPtr IDataType::create_column_const(size_t size, const Field& field) 
const {
     auto column = create_column();
-    column->reserve(1);
     column->insert(field);
     return ColumnConst::create(std::move(column), size);
 }
diff --git a/be/src/vec/functions/function.h b/be/src/vec/functions/function.h
index 1e0ae417cab..8e0bca3c08a 100644
--- a/be/src/vec/functions/function.h
+++ b/be/src/vec/functions/function.h
@@ -424,54 +424,6 @@ protected:
     }
 };
 
-/// Wrappers over IFunction. If we (default)use DefaultFunction as wrapper, 
all function execution will go through this.
-
-class DefaultExecutable final : public PreparedFunctionImpl {
-public:
-    explicit DefaultExecutable(std::shared_ptr<IFunction> function_)
-            : function(std::move(function_)) {}
-
-    String get_name() const override { return function->get_name(); }
-
-protected:
-    Status execute_impl(FunctionContext* context, Block& block, const 
ColumnNumbers& arguments,
-                        uint32_t result, size_t input_rows_count) const final {
-        return function->execute_impl(context, block, arguments, result, 
input_rows_count);
-    }
-
-    Status evaluate_inverted_index(
-            const ColumnsWithTypeAndName& arguments,
-            const std::vector<vectorized::IndexFieldNameAndTypePair>& 
data_type_with_names,
-            std::vector<segment_v2::IndexIterator*> iterators, uint32_t 
num_rows,
-            segment_v2::InvertedIndexResultBitmap& bitmap_result) const {
-        return function->evaluate_inverted_index(arguments, 
data_type_with_names, iterators,
-                                                 num_rows, bitmap_result);
-    }
-
-    Status execute_impl_dry_run(FunctionContext* context, Block& block,
-                                const ColumnNumbers& arguments, uint32_t 
result,
-                                size_t input_rows_count) const final {
-        return function->execute_impl_dry_run(context, block, arguments, 
result, input_rows_count);
-    }
-    bool use_default_implementation_for_nulls() const final {
-        return function->use_default_implementation_for_nulls();
-    }
-
-    bool skip_return_type_check() const final { return 
function->skip_return_type_check(); }
-    bool need_replace_null_data_to_default() const final {
-        return function->need_replace_null_data_to_default();
-    }
-    bool use_default_implementation_for_constants() const final {
-        return function->use_default_implementation_for_constants();
-    }
-    ColumnNumbers get_arguments_that_are_always_constant() const final {
-        return function->get_arguments_that_are_always_constant();
-    }
-
-private:
-    std::shared_ptr<IFunction> function;
-};
-
 /*
  * when we register a function which didn't specify its base(i.e. inherited 
from IFunction), actually we use this as a wrapper.
  * it saves real implementation as `function`. 
@@ -493,7 +445,7 @@ public:
     PreparedFunctionPtr prepare(FunctionContext* context, const Block& 
/*sample_block*/,
                                 const ColumnNumbers& /*arguments*/,
                                 uint32_t /*result*/) const override {
-        return std::make_shared<DefaultExecutable>(function);
+        return function;
     }
 
     Status open(FunctionContext* context, FunctionContext::FunctionStateScope 
scope) override {
@@ -531,7 +483,7 @@ public:
             : function(std::move(function_)) {}
 
     void check_number_of_arguments(size_t number_of_arguments) const override {
-        return function->check_number_of_arguments(number_of_arguments);
+        function->check_number_of_arguments(number_of_arguments);
     }
 
     String get_name() const override { return function->get_name(); }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to