HappenLee commented on code in PR #32333:
URL: https://github.com/apache/doris/pull/32333#discussion_r1528041827


##########
be/src/vec/functions/like.cpp:
##########
@@ -60,6 +60,129 @@ static const re2::RE2 
LIKE_STARTS_WITH_RE(R"((((\\%)|(\\_)|([^%_\\]))+)(?:%+))")
 static const re2::RE2 LIKE_EQUALS_RE("(((\\\\_)|([^%_]))+)");
 static const re2::RE2 LIKE_ALLPASS_RE("%+");
 
+struct VectorAllpassSearchState : public VectorPatternSearchState {
+    VectorAllpassSearchState() : 
VectorPatternSearchState(FunctionLikeBase::vector_allpass_fn) {}
+
+    ~VectorAllpassSearchState() override = default;
+
+    void like_pattern_match(const std::string& pattern_str) override {
+        if (!pattern_str.empty() && RE2::FullMatch(pattern_str, 
LIKE_ALLPASS_RE)) {
+            _search_strings->insert_default();
+        } else {
+            _pattern_matched = false;
+        }
+    }
+
+    void regexp_pattern_match(const std::string& pattern_str) override {
+        if (RE2::FullMatch(pattern_str, ALLPASS_RE)) {
+            _search_strings->insert_default();
+        } else {
+            _pattern_matched = false;
+        }
+    }
+};
+
+struct VectorEqualSearchState : public VectorPatternSearchState {
+    VectorEqualSearchState() : 
VectorPatternSearchState(FunctionLikeBase::vector_equals_fn) {}

Review Comment:
   no need copy the fn. better be static



-- 
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

Reply via email to