Skip to content

Conversation

hawkfish
Copy link
Contributor

Add a new variant that takes a list of field names and produces a STRUCT of all the capture groups.

Richard Wesley added 2 commits March 30, 2023 13:36
Add a new variant that takes a list of field names and produces a STRUCT
of all the capture groups.
@hawkfish hawkfish requested a review from lnkuiper March 30, 2023 20:43
Fix release unused variable.
Copy link
Contributor

@Tishj Tishj left a comment

Choose a reason for hiding this comment

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

Looks good, just had a comment about an optimization we could do
(could be considered not an optimization as well, in the case where you have a really big string and the groups are only a small portion of the string, then keeping this string alive needlessly might be wasteful)

Reuse the input string memory instead of allocating new buffers for each group column.
@hawkfish hawkfish removed the request for review from lnkuiper April 1, 2023 15:13
@hawkfish
Copy link
Contributor Author

hawkfish commented Apr 1, 2023

Looks good, just had a comment about an optimization we could do
(could be considered not an optimization as well, in the case where you have a really big string and the groups are only a small portion of the string, then keeping this string alive needlessly might be wasteful)

A good point, but I have to say that having worked on a text shaping engine, you don't usually end up with a lot of filler data, so I think reuse is the way to go.

Copy link
Collaborator

@Mytherin Mytherin left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Looks good. Some comments:

@Mytherin Mytherin merged commit 7ea0ea5 into duckdb:master Apr 14, 2023
@Mytherin
Copy link
Collaborator

Thanks! LGTM

@hawkfish hawkfish deleted the regex-struct branch April 14, 2023 22:08
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