2017-03-21 1 views
0

저는 table_date로 파티션 된 하이브 테이블을 가지고 있습니다. 특정 월 및 특정 연도의 특정 날짜에 대한 개별 파티션 수를 얻고 싶습니다.하이브에서 특정 달의 특정 파티션을 계산합니다.

다음 쿼리를 실행하면 한 달 전체로 계산되지만 개별 일로 지정하려고합니다. 이 날짜에 분할되어있는 경우

select count(*) from table where month(table_date)=1 and year(table _date)=2016 
+0

은 (table_date)','달 table_date''또는 년'에서 파티션 테이블 (인가 table_date)'와'day (table_date)'? –

답변

0

, 나는이 일을 기대 :

select table_date, count(*) 
from table 
where table_date >= '2016-01-01' and table_date < '2016-02-01' 
group by table_date; 
0
select table_date, count(*) 
from table 
where table_date between '2016-01-01' and '2016-02-01' 
group by table_date; 
관련 문제