diff --git a/be/src/vec/functions/function_fake.cpp b/be/src/vec/functions/function_fake.cpp index faf8d0d525..7e6cc25d04 100644 --- a/be/src/vec/functions/function_fake.cpp +++ b/be/src/vec/functions/function_fake.cpp @@ -17,11 +17,11 @@ #include "vec/functions/function_fake.h" -#include -#include -#include - +#include "vec/data_types/data_type_array.h" #include "vec/data_types/data_type_nullable.h" +#include "vec/data_types/data_type_number.h" +#include "vec/functions/function_helpers.h" +#include "vec/functions/simple_function_factory.h" namespace doris::vectorized { @@ -33,6 +33,7 @@ struct FunctionFakeBaseImpl { } return std::make_shared(); } + static std::string get_error_msg() { return "Fake function do not support execute"; } }; struct FunctionExplode { @@ -41,11 +42,19 @@ struct FunctionExplode { return make_nullable( check_and_get_data_type(arguments[0].get())->get_nested_type()); } + static std::string get_error_msg() { return "Fake function do not support execute"; } }; -template -void register_function_default(SimpleFunctionFactory& factory, const std::string& name) { - factory.register_function>>(name); +struct FunctionEsquery { + static DataTypePtr get_return_type_impl(const DataTypes& arguments) { + return FunctionFakeBaseImpl::get_return_type_impl(arguments); + } + static std::string get_error_msg() { return "esquery only supported on es table"; } +}; + +template +void register_function(SimpleFunctionFactory& factory, const std::string& name) { + factory.register_function>(name); }; template @@ -74,7 +83,7 @@ void register_table_function_expand_outer_default(SimpleFunctionFactory& factory }; void register_function_fake(SimpleFunctionFactory& factory) { - register_function_default(factory, "esquery"); + register_function(factory, "esquery"); register_table_function_expand_outer(factory, "explode"); diff --git a/be/src/vec/functions/function_fake.h b/be/src/vec/functions/function_fake.h index 475850671e..0f2c83aed0 100644 --- a/be/src/vec/functions/function_fake.h +++ b/be/src/vec/functions/function_fake.h @@ -18,14 +18,7 @@ #pragma once #include "common/status.h" -#include "vec/core/types.h" -#include "vec/data_types/data_type_array.h" -#include "vec/data_types/data_type_nullable.h" -#include "vec/data_types/data_type_number.h" -#include "vec/data_types/data_type_string.h" -#include "vec/functions/function_helpers.h" -#include "vec/functions/simple_function_factory.h" -#include "vec/utils/util.hpp" +#include "vec/functions/function.h" namespace doris::vectorized { // FunctionFake is use for some function call expr only work at prepare/open phase, do not support execute(). @@ -50,7 +43,7 @@ public: Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, size_t result, size_t input_rows_count) override { - return Status::NotSupported("Fake function {} do not support execute", name); + return Status::NotSupported(Impl::get_error_msg()); } }; diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java index 17eebe567a..6cc8e6da7c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java @@ -853,6 +853,7 @@ public class FunctionCallExpr extends Expr { if (!getChild(1).isConstant()) { throw new AnalysisException(fnName + "function's second argument should be constant"); } + throw new AnalysisException(fnName + "not support on vectorized engine now."); } if ((fnName.getFunction().equalsIgnoreCase("HLL_UNION_AGG")