Skip to content

refactor: use a common macro to define math UDFs#9598

Merged
alamb merged 6 commits into
apache:mainfrom
jonahgao:math_macro
Mar 13, 2024
Merged

refactor: use a common macro to define math UDFs#9598
alamb merged 6 commits into
apache:mainfrom
jonahgao:math_macro

Conversation

@jonahgao

@jonahgao jonahgao commented Mar 13, 2024

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #9552.

Rationale for this change

Use a common macro to define unary math UDFs, aiming to reduce code duplication and facilitate subsequent porting.
These functions include
https://github.com/apache/arrow-datafusion/blob/0302d6530a5a7fffe7da40e0f3b13794a9c693ff/datafusion/physical-expr/src/math_expressions.rs#L158-L178

What changes are included in this PR?

Are these changes tested?

Yes. By existing tests.

Are there any user-facing changes?

No

@jonahgao jonahgao marked this pull request as draft March 13, 2024 14:26
@jonahgao jonahgao marked this pull request as ready for review March 13, 2024 15:13

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👨‍🍳 👌

Very nice @jonahgao

@alamb

alamb commented Mar 13, 2024

Copy link
Copy Markdown
Contributor

This is a really nice design

Comment thread datafusion/functions/src/macros.rs Outdated
Co-authored-by: comphead <comphead@users.noreply.github.com>

@comphead comphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @jonahgao
nice change

@jonahgao

Copy link
Copy Markdown
Member Author

Thank you for the review! @alamb @comphead

@comphead comphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm thanks @jonahgao

@alamb alamb merged commit 60f6514 into apache:main Mar 13, 2024
@alamb

alamb commented Mar 13, 2024

Copy link
Copy Markdown
Contributor

Merging to get this (good) new pattern estabilished before too many other functions get ported

@jonahgao jonahgao deleted the math_macro branch March 14, 2024 08:24
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.

Eliminate code duplication between math UDFs

3 participants