Tanya-W commented on code in PR #19936: URL: https://github.com/apache/doris/pull/19936#discussion_r1208838469
########## be/src/vec/functions/match.cpp: ########## @@ -15,134 +15,167 @@ // specific language governing permissions and limitations // under the License. -#include <stddef.h> - -#include <algorithm> -#include <boost/iterator/iterator_facade.hpp> -#include <memory> -#include <ostream> -#include <string> -#include <utility> - -#include "common/config.h" -#include "common/consts.h" -#include "common/logging.h" -#include "common/status.h" -#include "vec/aggregate_functions/aggregate_function.h" -#include "vec/columns/column.h" -#include "vec/core/block.h" -#include "vec/core/column_numbers.h" -#include "vec/core/column_with_type_and_name.h" -#include "vec/core/types.h" -#include "vec/data_types/data_type_number.h" -#include "vec/functions/function.h" -#include "vec/functions/simple_function_factory.h" - -namespace doris { -class FunctionContext; -} // namespace doris +#include "vec/functions/match.h" -namespace doris::vectorized { - -class FunctionMatchBase : public IFunction { -public: - size_t get_number_of_arguments() const override { return 2; } - - String get_name() const override { return "match"; } +#include "olap/rowset/segment_v2/inverted_index_reader.h" +#include "runtime/query_context.h" +#include "runtime/runtime_state.h" - /// Get result types by argument types. If the function does not apply to these arguments, throw an exception. - DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { - return std::make_shared<DataTypeUInt8>(); - } +namespace doris::vectorized { - Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, - size_t result, size_t input_rows_count) override { - auto match_query_str = block.get_by_position(arguments[1]).to_string(0); - std::string column_name = block.get_by_position(arguments[0]).name; - auto match_pred_column_name = - BeConsts::BLOCK_TEMP_COLUMN_PREFIX + column_name + "_match_" + match_query_str; - if (!block.has(match_pred_column_name)) { - if (!config::enable_index_apply_preds_except_leafnode_of_andnode) { - return Status::Cancelled( - "please check whether turn on the configuration " - "'enable_index_apply_preds_except_leafnode_of_andnode'"); - } - LOG(WARNING) << "execute match query meet error, block no column: " - << match_pred_column_name; - return Status::InternalError( - "match query meet error, no match predicate evaluate result column in block."); +Status FunctionMatchBase::execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, + size_t result, size_t input_rows_count) { + auto match_query_str = block.get_by_position(arguments[1]).to_string(0); + std::string column_name = block.get_by_position(arguments[0]).name; + auto match_pred_column_name = + BeConsts::BLOCK_TEMP_COLUMN_PREFIX + column_name + "_match_" + match_query_str; + if (!block.has(match_pred_column_name)) { + LOG(INFO) << "begin to execute match directly, column_name=" << column_name Review Comment: updated -- 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-unsubscr...@doris.apache.org 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