dev:

    1. 软件环境:

        kylin:1.5.2-cdh5.7.1 
        hadoop:2.6.0-cdh5.7.1 
        hive:1.1.0-cdh5.7.1
        hbase:1.2.0-cdh5.7.1 
        JDK: 1.7.0_67
    
    2. 问题描述:

      在Kylin Web GUI用union all合并两个cube结果时,返回结果不正确。哪位知道是什么原因导致
    例:
     1)分别查询两张已建cube的表
          
          查询sql:                                                                
                  查询sql:
          select dim01,                                                         
                   select dim01, 
                    sum(val_cnt) as val_cnt1,                                   
                       sum(val_cnt) as val_cnt1,
                    1 as flag                                                   
                                  2 as flag
           from td_idx_1000100001_1                                             
          from td_idx_1000100002_1 
         group by dim01;                                                        
             group by dim01;
         
          返回结果:                                                                 
               返回结果:
          DIM01 VAL_CNT1 FLAG                                                   
           DIM01 VAL_CNT1 FLAG
          A0001   40031.37  1                                                   
                 A0001   40207.42 2
          A0002   41613.63  1                                                   
                 A0002   41698.91 2
          A0003   42260.19  1                                                   
                 A0003   42390.84 2

       2)用union all进行合并查询
       
         查询sql:        
        select dim01,
                  sum(val_cnt) as val_cnt1,
                 1 as flag
        from td_idx_1000100001_1
      group by dim01
 union all
      select dim01,
                sum(val_cnt) as val_cnt1,
                2 as flag
      from td_idx_1000100002_1
    group by dim01

          预期返回结果:                            实际返回结果:
          DIM01 VAL_CNT1 FLAG              DIM01 VAL_CNT1 FLAG
          A0001 40031.37  1                      A0001 40207.42  1  
          A0002 41613.63  1                      A0002 41698.91  1  
          A0003 42260.19  1                      A0003 42390.84  1  
          A0001 40207.42  2                      A0001 40207.42  2  
          A0002 41698.91  2                      A0002 41698.91  2  
          A0003 42390.84  2                      A0003 42390.84  2 

        发现FLAG =1 时的 VAL_CNT1  值不正确,查询的值恰好是最后一个union all表的值。

       3)多表union all 及两张表left join亦是如此


相关日志:
        SQL: select dim01,
        sum(val_cnt) as val_cnt1,
        1 as flag
        from td_idx_1000100001_1
        group by dim01
        union all
        select dim01,
        sum(val_cnt) as val_cnt1,
        2 as flag
        from td_idx_1000100002_1
        group by dim01
        order by flag,dim01
        User: ADMIN
        Success: true
        Duration: 0.069
        Project: asiainfo_kylin
        Realization Names: [cube_1000100002_1]
        Cuboid Ids: [16]
        Total scan count: 6
        Result row count: 6
        Accept Partial: true
        Is Partial Result: false
        Hit Exception Cache: false
        Storage cache used: false
        Message: null






nidongdong1987

Reply via email to