Impala query:
Select a case when t.n l>=18 and t.n l<25 then='18 to 25'
The when t.n l>=26 and t.n l<32 then='26-32'
The when t.n l> 33 and t.n l<33 -=40 then '40'
The when t.n l>=41 and t.n l<48 then='41-49'
The when t.n l>=49 and t.n l<=55 then '49-55'
JLS end as NLD, count (1)
The from
(select
The case when length (SFZH)=18 then
Cast (from_unixtime (unix_timestamp (XXRQ, 'MM - dd yyyy -'), 'yyyy) as int) - cast (substr (SFZH, 7, 4) as int)
The else cast (from_unixtime (unix_timestamp (XXRQ, 'MM - dd yyyy -'), 'yyyy) as int) - cast (concat (' 19' substr (SFZH, 7, 2)) as int)
End as nl, XXRQ, SFZH from hbase_impala. Impala_table39119_1550771711308
Where SFZH is not null and year (now ()) - year (XXRQ) & lt;=4
) t
Where t.n l>=18 and t.n l<=55 group by NLD order by NLD;
Explain the :
CodePudding user response:
Has analyzed the table is so slow, SQL problem