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

Aggregation functions should ignore NULL values

XMLWordPrintable

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

      For example, this query returns 3 (in QueryDslConditionsTest)

      public void testCountNull() {
          QueryFactory qf = getQueryFactory();
          Query q = qf.from(getModelFactory().getUserImplClass())
                  .select(Expression.count("age"))
                  .build();
      

      while only 1 value is non-null.
      It might be good to behave like JPA, which ignores NULL values:
      "Null values are eliminated before the aggregate function is applied, regardless of whether the keyword DISTINCT is specified." http://download.oracle.com/otn-pub/jcp/persistence-2.0-fr-eval-oth-JSpec/persistence-2_0-final-spec.pdf?AuthParam=1441633088_b920076e17d14a7f5faa4677495f61f0

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

                Created:
                Updated:
                Resolved: