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: enable optional UDF arguments in regexp_* functions #10512

Closed
Michael-J-Ward opened this issue May 15, 2024 · 1 comment · Fixed by #10514
Closed

feat: enable optional UDF arguments in regexp_* functions #10512

Michael-J-Ward opened this issue May 15, 2024 · 1 comment · Fixed by #10514
Labels
enhancement New feature or request

Comments

@Michael-J-Ward
Copy link
Contributor

Michael-J-Ward commented May 15, 2024

Is your feature request related to a problem or challenge?

The same discussion / reasoning as in #10424.

The inner implementation for these UDFs changes based on the number of parameters passed, but the API of the exported regex::expr_fn::* does not enable that.

Describe the solution you'd like

The same solution as implemented #10469, change the exported expr_fns to take Option<Expr> for optional arguments.

Describe alternatives you've considered

Alternatives discussed in the prior issue:

  • change expr_fn to take a Vec instead of explicit arguments
  • maintain a different exported expr_fn for each set of non-null parameters

Additional context

No response

@Michael-J-Ward Michael-J-Ward added the enhancement New feature or request label May 15, 2024
@Michael-J-Ward
Copy link
Contributor Author

take.

will have a PR up shortly

Michael-J-Ward added a commit to Michael-J-Ward/datafusion that referenced this issue May 15, 2024
This also updates the argument names to match what is used in the inner impl.

Ref apache#10512
Michael-J-Ward added a commit to Michael-J-Ward/datafusion that referenced this issue May 15, 2024
This also updates the argument names to match the inner impl.

Ref apache#10512
Michael-J-Ward added a commit to Michael-J-Ward/datafusion that referenced this issue May 15, 2024
This also updates the argument names to match the inner impl.

Ref apache#10512
jonahgao pushed a commit that referenced this issue May 15, 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 #10512

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

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

Ref #10512

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

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

Ref #10512

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

* refactor: use datafusion_expr::Expr declaration
findepi pushed a commit to findepi/datafusion that referenced this issue 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
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant