hive-user mailing list archives

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

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,
       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

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.
How can I make query running on HIVE?

Sanjiv Singh
Mob :  +091 9990-447-339

View raw message