Skip to content

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

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

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

Conversation

@jonahgao
Copy link
Member

@jonahgao jonahgao commented Mar 13, 2024

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
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

👨‍🍳 👌

Very nice @jonahgao

@alamb
Copy link
Contributor

alamb commented Mar 13, 2024

This is a really nice design

Co-authored-by: comphead <comphead@users.noreply.github.com>
Copy link
Contributor

@comphead comphead left a comment

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
Member Author

Thank you for the review! @alamb @comphead

Copy link
Contributor

@comphead comphead left a comment

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
Copy link
Contributor

alamb commented Mar 13, 2024

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