superdiaodiao commented on code in PR #39354: URL: https://github.com/apache/doris/pull/39354#discussion_r1739618744
########## be/src/vec/functions/functions_multi_string_search.cpp: ########## @@ -140,35 +128,34 @@ class FunctionsMultiStringSearch : public IFunction { return status; } - if (haystack_nullable) { - auto column_nullable = check_and_get_column<ColumnNullable>(haystack_column.get()); - auto& null_map = column_nullable->get_null_map_data(); - for (size_t i = 0; i != input_rows_count; ++i) { - if (null_map[i] == 1) { - vec_res[i] = 0; - } - } - } - - if (needles_nullable) { - auto column_nullable = check_and_get_column<ColumnNullable>(needles_column.get()); - auto& null_map = column_nullable->get_null_map_data(); - for (size_t i = 0; i != input_rows_count; ++i) { - if (null_map[i] == 1) { - vec_res[i] = 0; - } - } - } + handle_nullable_column(haystack_column, vec_res, input_rows_count); + handle_nullable_column(needles_column, vec_res, input_rows_count); block.replace_by_position(result, std::move(col_res)); return status; } private: + using ResultType = typename Impl::ResultType; + const bool allow_hyperscan_ = true; const size_t max_hyperscan_regexp_length_ = 0; // not limited const size_t max_hyperscan_regexp_total_length_ = 0; // not limited + + /// Handles nullable column by setting result to 0 if the input is null + void handle_nullable_column(const ColumnPtr& column, PaddedPODArray<ResultType>& vec_res, + size_t input_rows_count) const { + if (column->is_nullable()) { + const auto* column_nullable = check_and_get_column<ColumnNullable>(column.get()); Review Comment: OK, I will fix. -- 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