Skip to content

[CALCITE-7588] LIKE with ESCAPE symbols containing wildcards fails#4994

Open
snuyanzin wants to merge 1 commit into
apache:mainfrom
snuyanzin:calcite7588
Open

[CALCITE-7588] LIKE with ESCAPE symbols containing wildcards fails#4994
snuyanzin wants to merge 1 commit into
apache:mainfrom
snuyanzin:calcite7588

Conversation

@snuyanzin
Copy link
Copy Markdown
Contributor

Jira Link

CALCITE-7588

Changes Proposed

The PR fixes the behavior of LIKE with ESCAPE containing wildcard symbols

private static Pattern getWildCardPattern(char escape) {
switch (escape) {
case '%':
return Pattern.compile("_+");
Copy link
Copy Markdown

@davidradl davidradl Jun 5, 2026

Choose a reason for hiding this comment

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

am I missing something - it looks like the case bodies are the wrong way round. % uses a Pattern with an underscore and underscore uses a pattern with %

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if % is escape symbol then it should not be a part of wildcard pattern

@xiedeyantu xiedeyantu added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants