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

Filtering doesn't work with sum aggregation

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • 8.0.0.Beta3
    • 8.0.0.Final
    • None
    • None

    Description

      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)
      ...
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: