在HIVE中,除了COUNT(*)外,COUNT还可以有很多高级用法。
转载自:http://jmeagher.net/blog/2012/3/28/complex-counts-in-hive.html
SELECT
type
, count(*)
, count(DISTINCT u)
, count(CASE WHEN plat=1 THEN u ELSE NULL END)
, count(DISTINCT CASE WHEN plat=1 TH[......]