Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-2948

Count a column returns the same result as count(*) even if this column has NULL

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: v2.1.0
    • Fix Version/s: v2.4.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      CentOS 7

      Description

      When we want to count a column(with same NULL value), there is different result from kylin and hive SQL. Is there a way to exclude NULL value in count measure calculation for a particular column?
      Here is the example:

      1. Here is source data:
      Date ID
      2017-10-10 dfe343ddfe3f5
      2017-10-11 fer234d656dff
      2017-10-11 NULL
      2017-10-12 jui6jnc3ncce3

      2. run SQL in Hive:
      select Date, count, count(ID) from table group by Date;
      2017-10-10 1 1
      2017-10-11 2 1
      2017-10-12 1 1

      3. run same SQL in Kylin:
      select Date, count, count(ID) from table group by Date;
      2017-10-10 1 1
      2017-10-11 2 2
      2017-10-12 1 1

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                luandexin DeXin
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: