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

Remove unnecessary projection in single_distinct_to_group_by rule #8086

Closed
haohuaijin opened this issue Nov 8, 2023 · 0 comments · Fixed by #8061
Closed

Remove unnecessary projection in single_distinct_to_group_by rule #8086

haohuaijin opened this issue Nov 8, 2023 · 0 comments · Fixed by #8061
Labels
enhancement New feature or request

Comments

@haohuaijin
Copy link
Contributor

haohuaijin commented Nov 8, 2023

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

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

Successfully merging a pull request may close this issue.

1 participant