-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(spark): implement Spark math function rint #16924
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
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.
Looks good to me
@shehabgamin and @comphead in case you would like a chance to review too
Thank you for driving this @chenkovsky |
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.
Just 1 comment. I think it's okay to merge as is and iterate further though!
pub fn new() -> Self { | ||
Self { | ||
signature: Signature::one_of( | ||
vec![Exact(vec![Float64]), Exact(vec![Float32])], |
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.
According to these docs, the input type might be a little bit more flexible?
https://docs.databricks.com/aws/en/sql/language-manual/functions/rint#arguments
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 added more types. please review it again
|
||
fn output_ordering(&self, input: &[ExprProperties]) -> Result<SortProperties> { | ||
// round preserves the order of the first argument | ||
let value = &input[0]; |
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.
it is good to check is not empy
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.
lgtm thanks @chenkovsky, some minors
Thanks @chenkovsky and @comphead and @shehabgamin |
* feat: spark rint * support all numeric * update * check empty for output ordering
Which issue does this PR close?
Rationale for this change
What changes are included in this PR?
implement spark rint udf
Are these changes tested?
UT
Are there any user-facing changes?
No