Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-5685

Filtering doesn't work with sum aggregation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.0.0.Final
    • 8.0.0.Beta3
    • None
    • None

      The following query

      public void testGroupBy() {
            QueryFactory qf = getQueryFactory();
            Query q = qf.from(getModelFactory().getTransactionImplClass())
                  .select(Expression.property("accountId"), Expression.sum("amount"))
                  .groupBy("accountId")
                  .having(Expression.sum("amount")).gt(3324)
                  .toBuilder().build();
      }
      

      in the context of QueryDslConditionsTest test class fails with:

      java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Double
      	at java.lang.Double.compareTo(Double.java:49)
      	at org.infinispan.objectfilter.impl.util.Interval.contains(Interval.java:92)
      	at org.infinispan.objectfilter.impl.predicateindex.IntervalCondition.match(IntervalCondition.java:19)
      	at org.infinispan.objectfilter.impl.predicateindex.IntervalCondition.match(IntervalCondition.java:9)
      	at org.infinispan.objectfilter.impl.predicateindex.Predicate.match(Predicate.java:37)
      	at org.infinispan.objectfilter.impl.predicateindex.Predicates.notifyMatchingSubscribers(Predicates.java:118)
      	at org.infinispan.objectfilter.impl.predicateindex.AttributeNode.processValue(AttributeNode.java:112)
      	at org.infinispan.objectfilter.impl.predicateindex.RowMatcherEvalContext.processAttributes(RowMatcherEvalContext.java:30)
      	at org.infinispan.objectfilter.impl.predicateindex.MatcherEvalContext.process(MatcherEvalContext.java:120)
      	at org.infinispan.objectfilter.impl.ObjectFilterImpl.filter(ObjectFilterImpl.java:73)
      	at org.infinispan.query.dsl.embedded.impl.HybridQuery$1.update(HybridQuery.java:75)
      	at org.infinispan.query.dsl.embedded.impl.HybridQuery$1.hasNext(HybridQuery.java:56)
      	at org.infinispan.query.dsl.embedded.impl.BaseEmbeddedQuery.listInternal(BaseEmbeddedQuery.java:72)
      	at org.infinispan.query.dsl.embedded.impl.BaseEmbeddedQuery.list(BaseEmbeddedQuery.java:63)
      	at org.infinispan.query.dsl.embedded.QueryDslConditionsTest.testGroupBy(QueryDslConditionsTest.java:1811)
      ...
      

              anistor Adrian Nistor (Inactive)
              jmarkos Jakub Markos (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: