Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-3448

Wrong count returned by count distinct and similar queries.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7
    • 1.8
    • sql
    • None

    Description

      Partitioned cache is deployed on 3 nodes.
      The code below outputs incorrect counts:
      14
      14

             IgniteCache<Integer, Value> cache = grid(0).cache(null);
      
              cache.put(0, new Value("v1"));
              cache.put(3, new Value("v1"));
              cache.put(5, new Value("v1"));
              cache.put(9, new Value("v1"));
      
              cache.put(1, new Value("v3"));
              cache.put(15, new Value("v3"));
              cache.put(8, new Value("v3"));
      
              cache.put(2, new Value("v5"));
              cache.put(12, new Value("v5"));
      
              cache.put(4, new Value("v2"));
              cache.put(6, new Value("v2"));
      
              cache.put(7, new Value("v6"));
      
              cache.put(10, new Value("v7"));
      
              cache.put(11, new Value("v8"));
      
              cache.put(13, new Value("v4"));
              cache.put(14, new Value("v4"));
      
              QueryCursor<List<?>> qry = cache.query(new SqlFieldsQuery("select count(distinct str) from Value"));
      
              for (List<?> objects : qry)
                  System.out.println(objects.get(0));
      
              qry = cache.query(new SqlFieldsQuery("select count(*) from (select 1 from Value group by str)"));
      
              for (List<?> objects : qry)
                  System.out.println(objects.get(0));
             
      

      Attachments

        Issue Links

          Activity

            People

              amashenkov Andrey Mashenkov
              ascherbakov Alexey Scherbakov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: