Haisheng Yuan created CALCITE-3159:
--------------------------------------

             Summary: Distinct can be removed for MIN/MAX/BIT_OR/BIT_AND 
aggregate functions
                 Key: CALCITE-3159
                 URL: https://issues.apache.org/jira/browse/CALCITE-3159
             Project: Calcite
          Issue Type: Improvement
          Components: core
            Reporter: Haisheng Yuan


For the following query:

{code:java}
select a, min(distinct b), bit_or(distinct c) from foo;
{code}

Currently Calcite still preserve the distinct for these aggregate functions, 
but DISTINCT is not meaningful with MIN/MAX and is available for ISO 
compatibility only. We can safely remove distinct and get more optimization 
opportunities.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to