Maksim Zhuravkov created IGNITE-22448:
-----------------------------------------

             Summary: Sql. Incorrect error message when aggregate function is 
called with UUID type
                 Key: IGNITE-22448
                 URL: https://issues.apache.org/jira/browse/IGNITE-22448
             Project: Ignite
          Issue Type: Bug
          Components: sql
            Reporter: Maksim Zhuravkov


When AVG called with DATE the validator returns the following error:

{noformat}
statement error: Cannot apply 'AVG' to arguments of type 'AVG(<DATE>)'. 
Supported form(s): 'AVG(<NUMERIC>)'
SELECT AVG('2011-01-01'::DATE)
{noformat}

But when AVG is called with UUID we get this: 

{noformat}
statement error: Unable to optimize plan due to internal error
SELECT AVG('c4a0327c-44be-416d-ae90-75c05079789f'::UUID)
{noformat}

Underlying cause:

{noformat}
java.lang.AssertionError: SUM is not supported for ANY
        at 
org.apache.ignite.internal.sql.engine.exec.exp.agg.Accumulators.unsupportedAggregateFunction(Accumulators.java:809)
        at 
org.apache.ignite.internal.sql.engine.exec.exp.agg.Accumulators.sumFactory(Accumulators.java:138)
        at 
org.apache.ignite.internal.sql.engine.exec.exp.agg.Accumulators.accumulatorFunctionFactory(Accumulators.java:83)
        at 
org.apache.ignite.internal.sql.engine.exec.exp.agg.Accumulators.accumulatorFactory(Accumulators.java:66)
        at 
org.apache.ignite.internal.sql.engine.util.PlanUtils.addAccumulatorFields(PlanUtils.java:130)
        at 
org.apache.ignite.internal.sql.engine.util.PlanUtils.createHashAggRowType(PlanUtils.java:118)
        at 
org.apache.ignite.internal.sql.engine.rel.agg.IgniteMapHashAggregate.deriveRowType(IgniteMapHashAggregate.java:93)
        at 
org.apache.calcite.rel.AbstractRelNode.getRowType(AbstractRelNode.java:174)
        at 
org.apache.ignite.internal.sql.engine.rel.agg.MapReduceAggregates.buildAggregates(MapReduceAggregates.java:196)
        at 
org.apache.ignite.internal.sql.engine.rule.HashAggregateConverterRule$MapReduceHashAggregateConverterRule.convert(HashAggregateConverterRule.java:157)
        at 
org.apache.ignite.internal.sql.engine.rule.HashAggregateConverterRule$MapReduceHashAggregateConverterRule.convert(HashAggregateConverterRule.java:91)
        at 
org.apache.ignite.internal.sql.engine.rule.AbstractIgniteConverterRule.convert(AbstractIgniteConverterRule.java:51)
        
{noformat}





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

Reply via email to