The first is available in Hive since early versions (in versions older than
0.6.0, though, use COUNT(1) instead).
The second is available in Hive starting in version 0.11.0.


On 29 January 2014 21:41, unmesha sreeveni <unmeshab...@gmail.com> wrote:

> In SQL we have partion by and group by
>
> select deptno, count(*) c from emp group by deptno;
>
> DEPTNO C
> ------ -
> 10     3
> 20     5
> 30     6
>
> select deptno, count(*) over (partition by deptno) c from emp;
>
>
> DEPTNO C
> ------ -
> 10     3
> 10     3
> 10     3
> 20     5
> 20     5
> 20     5
> 20     5
> 20     5
> 30     6
> 30     6
> 30     6
> 30     6
> 30     6
> 30     6
> If we need to practice the same thing in HIVE what will be the option .
> Do we have the same in Hive?
> Pls suggest
>
> Thanks in Advance.
>
> --
> *Thanks & Regards*
>
> Unmesha Sreeveni U.B
> Junior Developer
>
> http://www.unmeshasreeveni.blogspot.in/
>
>
>


-- 
André Araújo
Big Data Consultant/Solutions Architect
The Pythian Group - Australia - www.pythian.com

Office (calls from within Australia): 1300 366 021 x1270
Office (international): +61 2 8016 7000  x270 *OR* +1 613 565 8696   x1270
Mobile: +61 410 323 559
Fax: +61 2 9805 0544
IM: pythianaraujo @ AIM/MSN/Y! or ara...@pythian.com @ GTalk

"Success is not about standing at the top, it's the steps you leave behind."
-- Iker Pou (rock climber)

-- 


--



Reply via email to