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