Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-4121

[impala] COUNT(DISTINCT col) returns wrong results

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: Impala 2.2.2
    • Fix Version/s: None
    • Component/s: Backend
    • Labels:
    • Environment:
      impala 2.2.0 hue 3.7.0

      Description

      COUNT(DISTINCT col) returns wrong results

      SELECT distinct L.AUDIENCEKEY
      FROM unica.BM_LUCKYDRAW L, unica.BM_FULFILLMENT F
      WHERE F.TREATMENTCODE = L.TREATMENTCODE
      AND F.AUDIENCELEVEL = L.AUDIENCELEVEL
      AND F.AUDIENCEKEY = L.AUDIENCEKEY
      AND L.CAMPAIGNCODE = 'C000000301'
      AND CDR_TYPE = 1
      AND F.PROVISIONPARAM4 = '100'
      AND TO_DATE(L.INSERT_DATE) = cast('2016-09-09' as timestamp) ;
      Return rows 36556 rows see in attach file.
      --------------------------------------------------------------------------------------
      but count distinct from below query
      SELECT count( distinct L.AUDIENCEKEY)
      FROM unica.BM_LUCKYDRAW L, unica.BM_FULFILLMENT F
      WHERE F.TREATMENTCODE = L.TREATMENTCODE
      AND F.AUDIENCELEVEL = L.AUDIENCELEVEL
      AND F.AUDIENCEKEY = L.AUDIENCEKEY
      AND L.CAMPAIGNCODE = 'C000000301'
      AND CDR_TYPE = 1
      AND F.PROVISIONPARAM4 = '100'
      AND TO_DATE(L.INSERT_DATE) = cast('2016-09-09' as timestamp) ;
      Return 36673 rows

        Attachments

        1. query_result (1).csv
          428 kB
          Siksit Santirojanakul

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              g1a5o2_impala_1bbc Siksit Santirojanakul
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: