Taras Ledkov created CALCITE-4818:
-------------------------------------

             Summary: AggregateExpandDistinctAggregatesRule 
                 Key: CALCITE-4818
                 URL: https://issues.apache.org/jira/browse/CALCITE-4818
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.27.0
            Reporter: Taras Ledkov
            Assignee: Taras Ledkov
             Fix For: 1.28.0


When SUM data type derivation is more complex, e.g.:
{code}
SUM(TINYINT | SMALLINT) -> INTEGER
SUM(INTEGER) -> BIGINT
SUM(BIGINT) -> DECIMAL
{code}

The rule {{AggregateExpandDistinctAggregatesRule}} creates the top aggregate 
calls with invalid type for not distinct calls.

e.g. {{SELECT SUM(comm), SUM(DISTINCT comm) FROM emp}}

Please take a look at the reproducer in the PR.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to