1. SQL:
select '201804' month_id,
'-1' std_prvnce_cd,
'-1' std_latn_cd,
sum(case
when t.billing_cycle_id = '201804' and
t.target_code = 'M1101100001' then
t.target_value
end) n_dy_yd_cz,
sum(case
when t.billing_cycle_id = '201803' and
t.target_code = 'M1101100001' then
t.target_value
end) n_sy_yd_cz
from ods_db.ta_collect_target_m t
where t.billing_cycle_id in ('201804', '201803', '201704')
and t.target_code in
('M1101100001', 'M1103100012', 'M1290100001', 'M1290100002')
group by '201804', '-1', '-1';
--201804 -1 -1 -1.0 2.85372191E8 <--result
2.SQL Explain Result:
Version:Hive 1.1, CDH 5.4.7
3.Problem:
*As we can see from the first picture, the fourth column in result should
be a double type, but it shows -1.0, this is incorrect.*
*The second picture, value expressions should be two double type, but it
shows string and double.*
*This problem has been resolved in 5.7.2, we want to know the related JIRAs
or reason.*
*Thanks!*