Uploaded image for project: 'JBoss Data Grid'
  1. JBoss Data Grid
  2. JDG-952

Null values are counted in remote queries with aggregations

    XMLWordPrintable

    Details

      Description

      The following test started to fail (it was not failing until indexNullAs was introduced):

              [Test]
              public void CountTest()
              {
                  IRemoteCache<int, User> userCache = remoteManager.GetCache<int, User>(NAMED_CACHE);
                  QueryRequest qr = new QueryRequest();
                  qr.QueryString = "select u.name, count(u.age) from sample_bank_account.User u group by u.name";
                  QueryResponse result = userCache.Query(qr);
       
                  List<Object[]> projections = RemoteQueryUtils.unwrapWithProjection(result);
       
                  Assert.AreEqual(2, projections.Count);
                  Assert.AreEqual("John" ,projections.ElementAt(0)[0]);
                  Assert.AreEqual(1, projections.ElementAt(0)[1]);
                  Assert.AreEqual("Spider", projections.ElementAt(1)[0]);
                  Assert.AreEqual(0, projections.ElementAt(1)[1]);
                  //^^^^fails here where it returns 2 even though age was not set for Spiders
              }
      
      

      The "age" field is declared in the Proto schema as follows:

            /*
           @Field(store = Store.YES, indexNullAs = "-1")
            */
           optional int32 age = 6; 
      

      Note: The age field is counted even when indexNullAs = "0"

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  anistor Adrian Nistor
                  Reporter:
                  mgencur Martin Gencur
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: