Skip to content

[Feature](function) support like with escape clause - #52146

Merged
BiteTheDDDDt merged 5 commits into
apache:masterfrom
BiteTheDDDDt:dev_0623
Jun 30, 2025
Merged

[Feature](function) support like with escape clause#52146
BiteTheDDDDt merged 5 commits into
apache:masterfrom
BiteTheDDDDt:dev_0623

Conversation

@BiteTheDDDDt

@BiteTheDDDDtBiteTheDDDDt commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

support like with escape clause

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@BiteTheDDDDt

Copy link
Copy Markdown
ContributorAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 17.31% (9/52) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage56.58% (15110/26705)
Line Coverage45.38% (135458/298473)
Region Coverage44.53% (68173/153081)
Branch Coverage39.09% (35001/89532)

Comment threadbe/src/vec/functions/like.cpp Outdated
std::string replace_pattern_by_escape(const StringRef& pattern, char escape_char) {
std::string result;
result.reserve(pattern.size);
for (size_t i = 0; i < pattern.size; ++i) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个代码得加单测

@BiteTheDDDDt

Copy link
Copy Markdown
ContributorAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 31.03% (9/29) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 17.31% (9/52) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage56.62% (15126/26714)
Line Coverage45.41% (135618/298621)
Region Coverage44.57% (68249/153117)
Branch Coverage39.16% (35079/89578)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 17.31% (9/52) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage61.92% (16274/26282)
Line Coverage51.41% (153431/298439)
Region Coverage48.81% (87905/180099)
Branch Coverage42.28% (43274/102354)

@BiteTheDDDDt

Copy link
Copy Markdown
ContributorAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 55.77% (29/52) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage56.63% (15130/26717)
Line Coverage45.45% (135714/298628)
Region Coverage44.65% (68368/153106)
Branch Coverage39.25% (35158/89576)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 55.77% (29/52) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage61.98% (16291/26285)
Line Coverage51.55% (153848/298446)
Region Coverage48.99% (88227/180084)
Branch Coverage42.49% (43485/102350)

inline std::string replace_pattern_by_escape(const StringRef& pattern, char escape_char) {
std::string result;
result.reserve(pattern.size);
for (size_t i = 0; i < pattern.size; ++i) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like "\n" --> like "\n"
like "\a"

like "\n" escape 'b'

\a

@BiteTheDDDDt

Copy link
Copy Markdown
ContributorAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 55.77% (29/52) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage57.05% (15366/26934)
Line Coverage46.15% (139457/302211)
Region Coverage45.48% (70676/155405)
Branch Coverage40.23% (37334/92790)

@BiteTheDDDDt

Copy link
Copy Markdown
ContributorAuthor

run buildall

@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Jun 30, 2025
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@BiteTheDDDDt
BiteTheDDDDt merged commit 1bfad89 into apache:masterJun 30, 2025
BiteTheDDDDt added a commit to BiteTheDDDDt/incubator-doris that referenced this pull request Jun 30, 2025
BiteTheDDDDt added a commit to BiteTheDDDDt/incubator-doris that referenced this pull request Jun 30, 2025
morrySnow pushed a commit that referenced this pull request Jul 2, 2025
koarz pushed a commit to koarz/doris that referenced this pull request Jul 4, 2025
koarz pushed a commit to koarz/doris that referenced this pull request Jul 4, 2025
koarz pushed a commit to koarz/doris that referenced this pull request Jul 4, 2025
BiteTheDDDDt added a commit to BiteTheDDDDt/incubator-doris that referenced this pull request Sep 1, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.dev/3.0.7-mergeddev/3.1.0-mergedreviewedusercaseImportant user case type label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@BiteTheDDDDt@hello-stephen@yiguolei@morrySnow@dataroaring