-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
move Atan2
, Atan
, Acosh
, Asinh
, Atanh
to datafusion-function
#9872
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -37,16 +37,8 @@ use strum_macros::EnumIter; | |||
#[derive(Debug, Clone, PartialEq, Eq, Hash, EnumIter, Copy)] | |||
pub enum BuiltinScalarFunction { | |||
// math functions | |||
/// atan | |||
Atan, | |||
/// atan2 | |||
Atan2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any particular reason that you did not migrate Atan2?
--ProjectionExec: expr=[atan(c11@0) as atan_c11] | ||
----RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 | ||
------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c11], output_ordering=[c11@0 ASC NULLS LAST], has_header=true | ||
--SortExec: expr=[atan_c11@0 ASC NULLS LAST] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test seems to show a regression (there is now a sort in it).
I wonder if the issue is that you need to specify montononicity (which is now possible after #9869 from @tinfoil-knight )?
Marking as draft as I think this PR is no longer waiting on feedback. Please mark it as ready for review when it is ready for another look |
887c48f
to
a77e882
Compare
Atan
, Acosh
, Asinh
, Atanh
to datafusion-function
Atan2
, Atan
, Acosh
, Asinh
, Atanh
to datafusion-function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me -- thank you @Weijun-H 🙏
@@ -68,6 +68,9 @@ get_optimal_return_type!(utf8_to_str_type, DataType::LargeUtf8, DataType::Utf8); | |||
// `utf8_to_int_type`: returns either a Int32 or Int64 based on the input type size. | |||
get_optimal_return_type!(utf8_to_int_type, DataType::Int64, DataType::Int32); | |||
|
|||
/// Creates a scalar function implementation for the given function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
signature: Signature, | ||
} | ||
|
||
impl Atan2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe if we have more two argument math functions we can eventually macroize this like we have a macro for single argument functions
merging this quickly to keep the train going and minimize potential conflicts |
…on` (apache#9872) * Refactor math functions in datafusion code * fic ci * fix: avoid regression * refactor: move atan2 function * chore: move atan2 test
Which issue does this PR close?
Relates #9285
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?