[JBoss JIRA] (ISPN-6076) Errors when the same column is both a gouping column and an aggregation column
by Adrian Nistor (JIRA)
[ https://issues.jboss.org/browse/ISPN-6076?page=com.atlassian.jira.plugin.... ]
Adrian Nistor updated ISPN-6076:
--------------------------------
Git Pull Request: https://github.com/infinispan/infinispan/pull/3942, https://github.com/infinispan/infinispan/pull/3943 (was: https://github.com/infinispan/infinispan/pull/3942)
> Errors when the same column is both a gouping column and an aggregation column
> ------------------------------------------------------------------------------
>
> Key: ISPN-6076
> URL: https://issues.jboss.org/browse/ISPN-6076
> Project: Infinispan
> Issue Type: Bug
> Components: Embedded Querying
> Affects Versions: 8.1.0.Final, 8.0.2.Final
> Reporter: Adrian Nistor
> Assignee: Adrian Nistor
> Fix For: 8.2.0.Beta1, 8.2.0.Final, 8.1.1.Final
>
>
> This should not be allowed.
> {code}
> public void testGroupingAndAggregationOnSameField() {
> QueryFactory qf = getQueryFactory();
> Query q = qf.from(getModelFactory().getUserImplClass())
> .select(Expression.count("surname"), Expression.sum("addresses.number"))
> .groupBy("surname")
> .build();
> List<Object[]> list = q.list(); // throws ClassCastException
> }
> {code}
> {code}
> java.lang.ClassCastException: java.lang.String cannot be cast to org.infinispan.objectfilter.impl.aggregation.Counter
> at org.infinispan.objectfilter.impl.aggregation.CountAccumulator.merge(CountAccumulator.java:24)
> at org.infinispan.objectfilter.impl.aggregation.FieldAccumulator.merge(FieldAccumulator.java:42)
> at org.infinispan.objectfilter.impl.aggregation.Grouper.addRow(Grouper.java:133)
> at org.infinispan.query.dsl.embedded.impl.AggregatingQuery.getBaseIterator(AggregatingQuery.java:52)
> at org.infinispan.query.dsl.embedded.impl.HybridQuery$1.<init>(HybridQuery.java:47)
> at org.infinispan.query.dsl.embedded.impl.HybridQuery.getIterator(HybridQuery.java:45)
> at org.infinispan.query.dsl.embedded.impl.BaseEmbeddedQuery.listInternal(BaseEmbeddedQuery.java:65)
> at org.infinispan.query.dsl.embedded.impl.BaseEmbeddedQuery.list(BaseEmbeddedQuery.java:57)
> at org.infinispan.query.dsl.embedded.impl.DelegatingQuery.list(DelegatingQuery.java:45)
> at org.infinispan.query.dsl.embedded.QueryDslConditionsTest.testEmbeddedSum(QueryDslConditionsTest.java:1959)
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ISPN-6076) Errors when the same column is both a gouping column and an aggregation column
by Adrian Nistor (JIRA)
[ https://issues.jboss.org/browse/ISPN-6076?page=com.atlassian.jira.plugin.... ]
Adrian Nistor updated ISPN-6076:
--------------------------------
Affects Version/s: 8.1.0.Final
> Errors when the same column is both a gouping column and an aggregation column
> ------------------------------------------------------------------------------
>
> Key: ISPN-6076
> URL: https://issues.jboss.org/browse/ISPN-6076
> Project: Infinispan
> Issue Type: Bug
> Components: Embedded Querying
> Affects Versions: 8.1.0.Final, 8.0.2.Final
> Reporter: Adrian Nistor
> Assignee: Adrian Nistor
> Fix For: 8.2.0.Beta1, 8.2.0.Final, 8.1.1.Final
>
>
> This should not be allowed.
> {code}
> public void testGroupingAndAggregationOnSameField() {
> QueryFactory qf = getQueryFactory();
> Query q = qf.from(getModelFactory().getUserImplClass())
> .select(Expression.count("surname"), Expression.sum("addresses.number"))
> .groupBy("surname")
> .build();
> List<Object[]> list = q.list(); // throws ClassCastException
> }
> {code}
> {code}
> java.lang.ClassCastException: java.lang.String cannot be cast to org.infinispan.objectfilter.impl.aggregation.Counter
> at org.infinispan.objectfilter.impl.aggregation.CountAccumulator.merge(CountAccumulator.java:24)
> at org.infinispan.objectfilter.impl.aggregation.FieldAccumulator.merge(FieldAccumulator.java:42)
> at org.infinispan.objectfilter.impl.aggregation.Grouper.addRow(Grouper.java:133)
> at org.infinispan.query.dsl.embedded.impl.AggregatingQuery.getBaseIterator(AggregatingQuery.java:52)
> at org.infinispan.query.dsl.embedded.impl.HybridQuery$1.<init>(HybridQuery.java:47)
> at org.infinispan.query.dsl.embedded.impl.HybridQuery.getIterator(HybridQuery.java:45)
> at org.infinispan.query.dsl.embedded.impl.BaseEmbeddedQuery.listInternal(BaseEmbeddedQuery.java:65)
> at org.infinispan.query.dsl.embedded.impl.BaseEmbeddedQuery.list(BaseEmbeddedQuery.java:57)
> at org.infinispan.query.dsl.embedded.impl.DelegatingQuery.list(DelegatingQuery.java:45)
> at org.infinispan.query.dsl.embedded.QueryDslConditionsTest.testEmbeddedSum(QueryDslConditionsTest.java:1959)
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ISPN-6076) Errors when the same column is both a gouping column and an aggregation column
by Adrian Nistor (JIRA)
[ https://issues.jboss.org/browse/ISPN-6076?page=com.atlassian.jira.plugin.... ]
Adrian Nistor updated ISPN-6076:
--------------------------------
Fix Version/s: 8.1.1.Final
> Errors when the same column is both a gouping column and an aggregation column
> ------------------------------------------------------------------------------
>
> Key: ISPN-6076
> URL: https://issues.jboss.org/browse/ISPN-6076
> Project: Infinispan
> Issue Type: Bug
> Components: Embedded Querying
> Affects Versions: 8.1.0.Final, 8.0.2.Final
> Reporter: Adrian Nistor
> Assignee: Adrian Nistor
> Fix For: 8.2.0.Beta1, 8.2.0.Final, 8.1.1.Final
>
>
> This should not be allowed.
> {code}
> public void testGroupingAndAggregationOnSameField() {
> QueryFactory qf = getQueryFactory();
> Query q = qf.from(getModelFactory().getUserImplClass())
> .select(Expression.count("surname"), Expression.sum("addresses.number"))
> .groupBy("surname")
> .build();
> List<Object[]> list = q.list(); // throws ClassCastException
> }
> {code}
> {code}
> java.lang.ClassCastException: java.lang.String cannot be cast to org.infinispan.objectfilter.impl.aggregation.Counter
> at org.infinispan.objectfilter.impl.aggregation.CountAccumulator.merge(CountAccumulator.java:24)
> at org.infinispan.objectfilter.impl.aggregation.FieldAccumulator.merge(FieldAccumulator.java:42)
> at org.infinispan.objectfilter.impl.aggregation.Grouper.addRow(Grouper.java:133)
> at org.infinispan.query.dsl.embedded.impl.AggregatingQuery.getBaseIterator(AggregatingQuery.java:52)
> at org.infinispan.query.dsl.embedded.impl.HybridQuery$1.<init>(HybridQuery.java:47)
> at org.infinispan.query.dsl.embedded.impl.HybridQuery.getIterator(HybridQuery.java:45)
> at org.infinispan.query.dsl.embedded.impl.BaseEmbeddedQuery.listInternal(BaseEmbeddedQuery.java:65)
> at org.infinispan.query.dsl.embedded.impl.BaseEmbeddedQuery.list(BaseEmbeddedQuery.java:57)
> at org.infinispan.query.dsl.embedded.impl.DelegatingQuery.list(DelegatingQuery.java:45)
> at org.infinispan.query.dsl.embedded.QueryDslConditionsTest.testEmbeddedSum(QueryDslConditionsTest.java:1959)
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months