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

count(*) with count(distinct) gives wrong results when hive.groupby.skewindata=true

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2.0
    • 1.2.1
    • Logical Optimizer
    • None

    Description

      When hive.groupby.skewindata=true, the following query based on TPC-H gives wrong results:

      set hive.groupby.skewindata=true;
      
      select l_returnflag, count(*), count(distinct l_linestatus)
      from lineitem
      group by l_returnflag
      limit 10;
      

      The query plan shows that it generates only one MapReduce job instead of two theoretically, which is dictated by hive.groupby.skewindata=true.

      The problem arises only when

      count(*)

      and

      count(distinct)

      exist together.

      Attachments

        1. HIVE-10971.1.patch
          62 kB
          Ashutosh Chauhan
        2. HIVE-10971.01.patch
          1.0 kB
          WangMeng

        Issue Links

          Activity

            People

              sjtufighter WangMeng
              sjtufighter WangMeng
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: