Uploaded image for project: 'Red Hat Data Grid'
  1. Red Hat Data Grid
  2. JDG-1304

Null values are counted in remote queries with aggregations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • JDG 7.1.1 CR2
    • JDG 7.1.0 CR1
    • HotRod C# client
    • None

      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"

              anistor Adrian Nistor (Inactive)
              mgencur Martin Gencur
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: