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

refactor: add macro for the binary math function in datafusion-function #9889

Merged
merged 3 commits into from
Apr 1, 2024

Conversation

Weijun-H
Copy link
Member

Which issue does this PR close?

Follows #9872

Rationale for this change

          Maybe if we have more two argument math functions we can eventually macroize this like we have a macro for single argument functions

Originally posted by @alamb in #9872 (comment)

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added logical-expr Logical plan and expressions physical-expr Physical Expressions labels Mar 31, 2024
@Weijun-H Weijun-H force-pushed the util-math-binary-function branch from b4be8a5 to 8cb744f Compare March 31, 2024 11:34
@github-actions github-actions bot removed logical-expr Logical plan and expressions physical-expr Physical Expressions labels Mar 31, 2024
@Weijun-H Weijun-H force-pushed the util-math-binary-function branch from 9fea373 to 2267af3 Compare March 31, 2024 11:39
@Weijun-H Weijun-H marked this pull request as ready for review March 31, 2024 11:42
@Weijun-H Weijun-H changed the title Refactor: math functions in datafusion code refactor: add macro for the binary math function in datafusion-function Mar 31, 2024
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.

Thank you @Weijun-H -- this looks great to me. It will also set up easy migration for other binary math functions

datafusion/functions/src/macros.rs Outdated Show resolved Hide resolved
@@ -39,6 +37,7 @@ make_math_unary_udf!(AtanhFunc, ATANH, atanh, atanh, Some(vec![Some(true)]));
make_math_unary_udf!(AsinhFunc, ASINH, asinh, asinh, Some(vec![Some(true)]));
make_math_unary_udf!(AcoshFunc, ACOSH, acosh, acosh, Some(vec![Some(true)]));
make_math_unary_udf!(AtanFunc, ATAN, atan, atan, Some(vec![Some(true)]));
make_math_binary_udf!(Atan2, ATAN2, atan2, atan2, Some(vec![Some(true)]));
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

@alamb
Copy link
Contributor

alamb commented Apr 1, 2024

I merged up from main so this PR will pass CI

@alamb alamb merged commit b698e5f into apache:main Apr 1, 2024
24 checks passed
@alamb
Copy link
Contributor

alamb commented Apr 1, 2024

Thanks again @Weijun-H -- this is great

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.

2 participants