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

query return inconsistent result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • v2.4.0
    • None
    • None
    • None

    Description

      three queries on same cube. obviously,the differ between query one and two is "group by os", however the second query have smaller "uv" and "pv", which is wrong, and query three return correct result.

      query one

      SELECT
      a.os,
      count(DISTINCT a.DUID) AS "uv",
      CASE WHEN sum(a.pv) IS NULL THEN 0 ELSE sum(a.pv) END AS "pv"
      FROM dw_netflow.visit_all a
      JOIN DW_NETFLOW.DW_DIM_DATE b ON a.dt = b.day_name
      WHERE a.dt = '2018-10-13'
      AND a.LABEL_TYPE = 'EVENT'
      group by a.os

      result

      OS uv pv
      other 4657 869656
      android 1713172 198955150
      ios 118205 8438544

       

      query two

      SELECT
      count(DISTINCT a.DUID) AS "uv",
      CASE WHEN sum(a.pv) IS NULL THEN 0 ELSE sum(a.pv) END AS "pv"
      FROM dw_netflow.visit_all a
      JOIN DW_NETFLOW.DW_DIM_DATE b ON a.dt = b.day_name
      WHERE a.dt = '2018-10-13'
      AND a.LABEL_TYPE = 'EVENT'

      result

      uv pv
      699022 30428195

       

      query three

      SELECT
      count(DISTINCT a.DUID) AS "uv",
      CASE WHEN sum(a.pv) IS NULL THEN 0 ELSE sum(a.pv) END AS "pv"
      FROM dw_netflow.visit_all a
      JOIN DW_NETFLOW.DW_DIM_DATE b ON a.dt = b.day_name
      WHERE a.dt = '2018-10-13'
      AND a.LABEL_TYPE = 'EVENT'
      AND a.os in ('ios','android','other')

      result

      uv pv
      1830387 208263350

      Attachments

        1. three.png
          29 kB
          wangxianbin
        2. two.png
          29 kB
          wangxianbin
        3. one.png
          34 kB
          wangxianbin

        Activity

          People

            Unassigned Unassigned
            whenwin wangxianbin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: