diff --git a/be/src/exprs/like_predicate.cpp b/be/src/exprs/like_predicate.cpp index 813d3bfbf9646..8ac13609ad0ba 100644 --- a/be/src/exprs/like_predicate.cpp +++ b/be/src/exprs/like_predicate.cpp @@ -49,7 +49,9 @@ bool LikePredicate::hs_compile_and_alloc_scratch(const std::string& pattern, Lik if (hs_compile(pattern.c_str(), HS_FLAG_ALLOWEMPTY | HS_FLAG_DOTALL | HS_FLAG_UTF8 | HS_FLAG_SINGLEMATCH, HS_MODE_BLOCK, nullptr, &state->database, &state->compile_err) != HS_SUCCESS) { std::stringstream error; - error << "Invalid hyperscan expression: " << std::string(slice.data, slice.size) << ": " + auto chopped_size = std::min(slice.size, 64); + auto ellipsis = (chopped_size < slice.size) ? "..." : ""; + error << "Invalid hyperscan expression: " << std::string(slice.data, chopped_size) << ellipsis << ": " << state->compile_err->message << PROMPT_INFO; LOG(WARNING) << error.str().c_str(); hs_free_compile_error(state->compile_err);