Skip to content

Add MultiDistinctToCrossJoin optimizer rule for parallel distinct aggregates #20942

@Dandandan

Description

@Dandandan

Is your feature request related to a problem or challenge?

Queries like count(DISTINCT hits.SearchPhrase), count(DISTINCT hits.MobilePhone), count(DISTINCT hits.MobilePhoneModel) still don't run in parallel as they can not be optimized using the SingleDistinctToGroupBy optimization.

Describe the solution you'd like

Change it to issue the distinct queries in a separate stage, joining the results (either using join or union but join has a advantage on memory usage and cache locality as it runs them one by one).

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformanceMake DataFusion faster

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions