-
Notifications
You must be signed in to change notification settings - Fork 5
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
kurtosis udaf #4
kurtosis udaf #4
Conversation
c9444da
to
26f4e39
Compare
@jatin510 Thank you |
src/lib.rs
Outdated
@@ -26,14 +26,15 @@ use datafusion::logical_expr::AggregateUDF; | |||
#[macro_use] | |||
pub mod macros; | |||
pub mod common; | |||
pub mod kurtosis; | |||
pub mod mode; | |||
|
|||
pub mod expr_extra_fn { | |||
pub use super::mode::mode; |
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.
pls add
pub use super::kurtosis::kurtosis;
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.
done
README.md
Outdated
``` | ||
|
||
## Done | ||
|
||
- [x] `mode(expression) -> scalar` - Returns the most frequent (mode) value from a column of data. | ||
- [x] `max_by(expression1, expression2) -> scalar` - Returns the value of `expression1` associated with the maximum value of `expression2`. | ||
- [x] `min_by(expression1, expression2) -> scalar` - Returns the value of `expression1` associated with the minimum value of `expression2`. | ||
- [x] `kurtosis(expression) -> scalar` - Returns the kurtosis, a measure of the `tailedness` of the distribution, for the given numeric values in `expression`. |
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 documentation is not same as one in code, we should have consistent documentation everywhere.
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.
made all the mentioned changes @dharanad
impl Debug for KurtosisFunction { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
f.debug_struct("KurtosisFunction") | ||
.field("signature", &self.signature) | ||
.finish() | ||
} | ||
} |
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 #[derive(Debug)]
macro should serve the purpose here.
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 seems that an explicit implementation of Debug will be more informative here.
README.md
Outdated
@@ -77,10 +77,20 @@ SELECT min_by(x, y) FROM VALUES (1, 10), (2, 5), (3, 15), (4, 8) as tab(x, y); | |||
-- | 2 | | |||
-- +---------------------+ | |||
|
|||
-- Get the kurtosis value of a column of numeric data. |
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 seems we have enough example, just a description in "Done" section, will be fine.
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.
made all the mentioned changes @dmitrybugakov
b98c6bb
to
33fbfd4
Compare
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 @jatin510
1cb20dc
to
a0cf8a8
Compare
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.
Which issue does this PR close?
Closes #12250 apache/datafusion#12250
Rationale for this change
I followed the changes in PR: apache/datafusion#12273
What changes are included in this PR?
Added a udaf to calculate the kurtosis.
Are these changes tested?
Added the test in main.rs file took reference from
mode
udaf.Are there any user-facing changes?