-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Port tan, tanh to datafusion-functions #9535
Conversation
datafusion/functions/src/math/tan.rs
Outdated
} | ||
|
||
fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> { | ||
if arg_types.len() != 1 { |
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.
I think this is a duplication with #9401, we can remove it, or use a simple internal_err
.
|
||
fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> { | ||
if arg_types.len() != 1 { | ||
return Err(plan_datafusion_err!( |
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.
The same as above.
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.
Except for the generate_signature_error_msg
, everything else looks good to me!
signature: Signature::uniform( | ||
1, | ||
vec![DataType::Float64, DataType::Float32], | ||
Volatility::Immutable, | ||
), |
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.
Except for the
generate_signature_error_msg
, everything else looks good to me!
I'm thinking about if the signature has a fixed number of args to 1, is it safe to ignore length checking of arg_types
in ScalarUDFImpl::return_type
? So the error message generation could be eliminated.
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.
I think it's safe, that's exactly what was done in PR 9401. We can verify it through a test in sqllogictest.
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.
I merged up from main to resolve conflicts on this PR |
Which issue does this PR close?
Part of #9285
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?