hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "@Sanjiv Singh" <sanjiv.is...@gmail.com>
Subject GROUPING() in hive
Date Sat, 11 Apr 2015 08:49:28 GMT
Hi,

I have given query , compatible to teradata. It have imported table in
dimension_tab using Sqoop. Tried to execute on HIVE , but unfortunately
compatible to hive.


SELECT fact_1_id,
       fact_2_id,
       SUM(sales_value) AS sales_value,
       *GROUPING(fact_1_id) AS f1g,
       GROUPING(fact_2_id) AS f2g*
FROM   dimension_tab
GROUP BY *CUBE (fact_1_id, fact_2_id)*
ORDER BY fact_1_id, fact_2_id;

Then I tried to make it HIVE compatible. Refer : WIKI
<https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation,+Cube,+Grouping+and+Rollup>

Fortunately,CUBE is available in HIVE , but with different syntax

i.e. *fact_1_id, fact_2_id WITH CUBE *. but form documentation,
GROUPING() is not available in HIVE.

Please help me if GROUPING() function is available in HIVE.
or
How can I make query running on HIVE?

Regards
Sanjiv Singh
Mob :  +091 9990-447-339

Mime
View raw message