Skip to content

Fix SIMILAR TO percent wildcard#22292

Open
akmhatey-ai wants to merge 1 commit into
apache:mainfrom
akmhatey-ai:codex/similar-to-percent-22263
Open

Fix SIMILAR TO percent wildcard#22292
akmhatey-ai wants to merge 1 commit into
apache:mainfrom
akmhatey-ai:codex/similar-to-percent-22263

Conversation

@akmhatey-ai
Copy link
Copy Markdown

Closes #22263.

Summary

  • translate SIMILAR TO pattern operands before the existing regex-match evaluation
  • map SQL wildcards % to .* and _ to . for scalar and array pattern expressions
  • add coverage for SELECT 'abc' SIMILAR TO 'a%';

Validation

  • cargo fmt --all --check
  • cargo clippy -p datafusion-physical-expr --all-targets --all-features -- -D warnings
  • cargo test -p datafusion-physical-expr expressions::binary::tests::test_similar_to --lib
  • cargo test -p datafusion-sqllogictest --test sqllogictests -- strings:86
  • git diff --check
  • git diff --cached --check
  • git diff --cached | gitleaks detect --pipe --redact --verbose --no-color

Full workspace test suite was not run locally.

Disclosure: I used AI-assisted tooling while preparing this patch.

@github-actions github-actions Bot added physical-expr Changes to the physical-expr crates sqllogictest SQL Logic Tests (.slt) labels May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-expr Changes to the physical-expr crates sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PostgreSQL compatibility: SIMILAR TO should treat % as a wildcard

1 participant