[ 
https://issues.apache.org/jira/browse/CALCITE-5717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17724766#comment-17724766
 ] 

Benchao Li commented on CALCITE-5717:
-------------------------------------

By saying "prune", I meant to drop the Aggregate totally, not prune fields of 
the Aggregate.

I understand the difference of "select 1 from emps group by ()" and "select 
distinct 1 from emps", and it seems not affect this optimization, I'll update 
the description to add more details about the proposal.

> Prune Project's input if project has no InputRef and the input has 1 row
> ------------------------------------------------------------------------
>
>                 Key: CALCITE-5717
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5717
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Benchao Li
>            Assignee: Benchao Li
>            Priority: Major
>              Labels: pull-request-available
>
> The idea is to improve SQL
> {code:sql}
> select 1 from emps group by ()
> {code}
> In this case, we can safely prune the Aggregate.
> This idea is brought up in the discussion of CALCITE-5506
> We can add this improvement to ProjectAggregateMergeRule



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to