Skip to content

Remove unnecessary projection in single_distinct_to_group_by rule #8086

@haohuaijin

Description

@haohuaijin

Is your feature request related to a problem or challenge?

In single_distinct_to_group_by rule, we used Projection to make the schema consistent before and after optimization. The Projection just do the Alias task and , so we can directly use Alias in aggregate function to eliminate Projection and make code more clear.

Describe the solution you'd like

use alias instead of projection in single_distinct_to_group_by rule.

the only problem is use alias may case a display error in explain plan, see #8061 (comment).
but the output column name is equal, see #8061 (comment)

Describe alternatives you've considered

No response

Additional context

No response

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