-
Notifications
You must be signed in to change notification settings - Fork 837
Support the aggregation functions argMax and argMin #642
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
Support the aggregation functions argMax and argMin #642
Conversation
Signed-off-by: JmPotato <ghzpotato@gmail.com>
|
Thanks for the contribution! Please review the labels and make any necessary changes. |
Signed-off-by: JmPotato <ghzpotato@gmail.com>
|
To add a stateless test is better, refer: |
@sundy-li When I try to add a statement like: SELECT argMax(a, b) from (select number as a, number as b from numbers_mt(10000) JOIN numbers_mt(10000));Then an error occurs: ERROR 1105 (HY000) at line 7: Code: 8, displayText = Unsupported function: "argMax".I think these lines should be ok to register the two new functions, what do I miss? impl AggregatorFunction {
pub fn register(map: FactoryFuncRef) -> Result<()> {
let mut map = map.write();
map.insert("count", AggregateCountFunction::try_create);
map.insert("min", AggregateMinFunction::try_create);
map.insert("max", AggregateMaxFunction::try_create);
map.insert("sum", AggregateSumFunction::try_create);
map.insert("avg", AggregateAvgFunction::try_create);
map.insert("argMin", AggregateArgMinFunction::try_create);
map.insert("argMax", AggregateArgMaxFunction::try_create);
Ok(())
}
} |
|
FuseQuery always uses lowercase function names to get functions. reference : |
Oops, thanks for pointing out! |
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #642 +/- ##
=======================================
- Coverage 80% 80% -1%
=======================================
Files 284 286 +2
Lines 13861 14070 +209
=======================================
+ Hits 11160 11320 +160
- Misses 2701 2750 +49
Continue to review full report at Codecov.
|
sundy-li
left a comment
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 for the contribution.
|
CI Passed |
Signed-off-by: JmPotato ghzpotato@gmail.com
Summary
argMaxandargMin.Changelog
Related Issues
Close #466.
Test Plan
Unit Tests
Stateless Tests