Skip to content

Introduce return_data_type for Aggregate function #7960

Closed

Description

@jayzhan211

Is your feature request related to a problem or challenge?

return_data_type is not the same as the data_type for List case. For example, data_type: List(Int64), return_data_type will be Int64

Ref: https://github.com/apache/arrow-datafusion/pull/7242/files

Describe the solution you'd like

Introduce return_data_type for Sum, and other Aggregate function

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. alamb commented on Oct 29, 2023

    @alamb
    Contributor

    I think we should do some more careful thinking of how to handle multi-phase aggregates where the intermediate type is not the same as the output type -- for example SUM(x) for non lists can use the same aggregate (as you can sum partial sums) but COUNT(x) does not -- the first phase must actually COUNT but the second needs to use SUM.

    This causes problems for #6937 where we might want to dynamically stop doing the first phase aggregation.

  2. jayzhan211 commented on Nov 12, 2023

    @jayzhan211
    ContributorAuthor

    TODO

    • min_max (single-phase)
    • median (two-phase, 1. collect values 2. compute median)
    • count (no need, data type is always i64)
    • avg (had been done)
  3. jayzhan211 commented on Jun 12, 2024

    @jayzhan211
    ContributorAuthor

    Reopen it if there is any concrete issue to solve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions