Skip to content
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 mean as synonym for avg #2922

Closed
andygrove opened this issue Jul 15, 2022 · 2 comments · Fixed by #2923
Closed

Support mean as synonym for avg #2922

andygrove opened this issue Jul 15, 2022 · 2 comments · Fixed by #2923
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@andygrove
Copy link
Member

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
This came up in datafusion-contrib/datafusion-python#56

Describe the solution you'd like
Support "mean" as well as "avg"

Describe alternatives you've considered
None

Additional context
None

@andygrove andygrove added enhancement New feature or request good first issue Good for newcomers labels Jul 15, 2022
@andygrove
Copy link
Member Author

If anyone is interested in picking this up, it looks like it is probably a one liner (plus tests).

We need to add an additional mapping here in datafusion/expr/src/aggregate_function.rs

impl FromStr for AggregateFunction {
    type Err = DataFusionError;
    fn from_str(name: &str) -> Result<AggregateFunction> {
        Ok(match name {
            "min" => AggregateFunction::Min,
            "max" => AggregateFunction::Max,
            "count" => AggregateFunction::Count,
            "avg" => AggregateFunction::Avg,

@BaymaxHWY
Copy link
Contributor

I'm interested in this. May i try it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants