Skip to content

Commit

Permalink
disable hyperscan because bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liutang123 committed Sep 19, 2024
1 parent c668be6 commit 51b46c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions be/src/vec/functions/function_jsonb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ class FunctionJsonSearch : public IFunction {
state_ptr->is_like_pattern = true;
const auto& search_str = col_search_string->get_data_at(i);
RETURN_IF_ERROR(
FunctionLike::construct_like_const_state(context, search_str, state_ptr));
FunctionLike::construct_like_const_state(context, search_str, state_ptr, false));
state = state_ptr.get();
}

Expand Down Expand Up @@ -1819,7 +1819,7 @@ class FunctionJsonSearch : public IFunction {
state->is_like_pattern = true;
const auto pattern_col = context->get_constant_col(2)->column_ptr;
const auto& pattern = pattern_col->get_data_at(0);
RETURN_IF_ERROR(FunctionLike::construct_like_const_state(context, pattern, state));
RETURN_IF_ERROR(FunctionLike::construct_like_const_state(context, pattern, state, false));
context->set_function_state(scope, state);
}
return Status::OK();
Expand Down
4 changes: 2 additions & 2 deletions be/src/vec/functions/like.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ void verbose_log_match(const std::string& str, const std::string& pattern_name,
}

Status FunctionLike::construct_like_const_state(FunctionContext* context, const StringRef& pattern,
std::shared_ptr<LikeState>& state) {
std::shared_ptr<LikeState>& state, bool try_hyperscan ) {
std::string pattern_str = pattern.to_string();
state->search_state.pattern_str = pattern_str;
std::string search_string;
Expand Down Expand Up @@ -889,7 +889,7 @@ Status FunctionLike::construct_like_const_state(FunctionContext* context, const

hs_database_t* database = nullptr;
hs_scratch_t* scratch = nullptr;
if (hs_prepare(context, re_pattern.c_str(), &database, &scratch).ok()) {
if (try_hyperscan && hs_prepare(context, re_pattern.c_str(), &database, &scratch).ok()) {
// use hyperscan
state->search_state.hs_database.reset(database);
state->search_state.hs_scratch.reset(scratch);
Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/functions/like.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class FunctionLike : public FunctionLikeBase {
Status open(FunctionContext* context, FunctionContext::FunctionStateScope scope) override;

static Status construct_like_const_state(FunctionContext*, const StringRef&,
std::shared_ptr<LikeState>&);
std::shared_ptr<LikeState>&, bool try_hyperscan = true);

friend struct LikeSearchState;
friend struct VectorAllpassSearchState;
Expand Down

0 comments on commit 51b46c1

Please sign in to comment.