Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-15848

count or sum distinct incorrect when hive.optimize.reducededuplication set to true

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.13.0
    • 2.3.0
    • None

    Description

      Test Table:

      create table test(id int,key int,name int);
      

      Data:

      id key name
      1 1 2
      1 2 3
      1 3 2
      1 4 2
      1 5 3

      Test SQL1:

      select id,count(Distinct key),count(Distinct name)
      from (select id,key,name from count_distinct_test group by id,key,name)m
      group by id;
      

      result:

      1 5 4

      expect:

      1 5 2

      Test SQL2:

      select id,count(Distinct name),count(Distinct key)
      from (select id,key,name from count_distinct_test group by id,name,key)m
      group by id;
      

      result:

      1 2 5

      Attachments

        1. HIVE-15848.1.patch
          26 kB
          Zoltan Haindrich
        2. HIVE-15848.2.patch
          26 kB
          Zoltan Haindrich

        Issue Links

          Activity

            People

              kgyrtkirk Zoltan Haindrich
              bill Biao Wu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m