Skip to content

Comments

Implement regexp_matches function#31935

Merged
DAlperin merged 18 commits intoMaterializeInc:mainfrom
DAlperin:dov/implement-regexp-matches
Mar 20, 2025
Merged

Implement regexp_matches function#31935
DAlperin merged 18 commits intoMaterializeInc:mainfrom
DAlperin:dov/implement-regexp-matches

Conversation

@DAlperin
Copy link
Member

Closes https://github.com/MaterializeInc/database-issues/issues/7096

Motivation

Tips for reviewer

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@DAlperin DAlperin requested review from a team as code owners March 18, 2025 15:18
@DAlperin DAlperin requested review from ParkMyCar and aljoscha and removed request for a team and aljoscha March 18, 2025 15:18
Comment on lines 3153 to 3154
let mut row = Row::default();
let mut packer = row.packer();
Copy link
Member

Choose a reason for hiding this comment

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

Here would be a good place to use SharedRow, to avoid reallocations in try_push_array.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you check if I'm holding SharedRow correctly?

Copy link
Contributor

Choose a reason for hiding this comment

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

@antiguru I might be missing an allocation somewhere, but how does SharedRow help? We need to return an iterator of owned Rows so allocating new Rows seems unavoidable?

Copy link
Contributor

@ParkMyCar ParkMyCar left a comment

Choose a reason for hiding this comment

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

Approved! But please add more test cases before merging

query error invalid regular expression flag: x
SELECT regexp_replace(s, regex, replacement, 'igx') FROM e;

# regexp_matches
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add more test cases? For example:

  • Assert the correct error response when the second (or third) argument(s) are not string literals
  • What happens when there are no matches on the source string?
  • When the provided modifier is not one of 'g' or 'i'
  • Test case insensitive matching with 'i'
  • Test regexp_matches when reading multiple rows from a table

@DAlperin DAlperin enabled auto-merge (squash) March 19, 2025 21:55
@DAlperin DAlperin disabled auto-merge March 19, 2025 22:03
@DAlperin DAlperin enabled auto-merge (squash) March 19, 2025 23:11
@DAlperin DAlperin merged commit d34391a into MaterializeInc:main Mar 20, 2025
86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants