Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-934

Multiple DISTINCT returns null grouping key value.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: None
    • Labels:
      None

      Description

      default> select count * from table1;
      col1, col2, col3
      -------------------------
      a, b-1, null
      a, b-2, null
      a, b-2, null
      a, b-3, null
      a, b-3, null
      a, b-3, null
      
      default> select col1,
      count(distinct col2) as cnt1,
      count(distinct case when col3 is not null then col2 else null end) as cnt2
      from table1
      group by col1;
      
      col1,cnt1,cnt2
      -------------------------------
      a,  2,  1
      null,  1,  1
      

      This query should return the below result.

      col1,cnt1,cnt2
      -------------------------------
      a, 3, 1
      

        Attachments

          Activity

            People

            • Assignee:
              hjkim Hyoungjun Kim
              Reporter:
              hjkim Hyoungjun Kim
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: