Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: optional args for regexp_* UDFs #10514

Merged
merged 6 commits into from
May 15, 2024

Conversation

Michael-J-Ward
Copy link
Contributor

Which issue does this PR close?

Closes #10512

Rationale for this change

The inner implementations of these UDFs depend on the number of arguments passed. This exposes that to users of the UDFs.

What changes are included in this PR?

for each of regexp_match regexp_likeandregexp_replace`

  • Changes / adds optional arguments to match inner impl
  • Updates argument names to match inner impl

Are these changes tested?

Yes. Each function already had a test case, and were updated to include variants for the optional arguments.

Are there any user-facing changes?

Yes.

  • expr_fn::regexp_replace signature has changed
  • expr_fn::regexp_like signature has changed
  • expr_fn::regexp_match signature has changed

…acro

This does not change any functionality but enables adding optional arguments to each fn.
This also updates the argument names to match what is used in the inner impl.

Ref apache#10512
This also updates the argument names to match the inner impl.

Ref apache#10512
This also updates the argument names to match the inner impl.

Ref apache#10512
@github-actions github-actions bot added the core Core DataFusion crate label May 15, 2024
@Michael-J-Ward Michael-J-Ward marked this pull request as ready for review May 15, 2024 01:27
@Michael-J-Ward
Copy link
Contributor Author

Requesting review from @jayzhan211 and @jonahgao

Copy link
Member

@jonahgao jonahgao 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 to me! Thank you @Michael-J-Ward

@jonahgao jonahgao merged commit 3ef90dd into apache:main May 15, 2024
23 checks passed
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
* refactor: declare `regex::expr_fn`s explicitly instead of using the macro

This does not change any functionality but enables adding optional arguments to each fn.

* feat: make `flag` argument optional for expr_fn::regexp_replace

This also updates the argument names to match what is used in the inner impl.

Ref apache#10512

* feat: add optional `flags` argument to expr_fn::regexp_match

This also updates the argument names to match the inner impl.

Ref apache#10512

* feat: add optional `flags` argument to expr_fn::regexp_like

This also updates the argument names to match the inner impl.

Ref apache#10512

* docs: clean up doc comments for expr_fn::regexp_*

* refactor: use datafusion_expr::Expr declaration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: enable optional UDF arguments in regexp_* functions
2 participants