hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Sears <andrew.se...@analyticsdream.com>
Subject Re: Best way of Unpivoting of hiva table data. Any Analytic function for unpivoting
Date Wed, 30 Mar 2016 21:23:48 GMT
 From mytable
Select id, 'mycol' as name, col1 as value
Union
Select id, 'mycol2' as name, col2 as value

Something like this might work for you?

Cheers,
Andrew


On Mon, Mar 28, 2016 at 7:53 PM, Ryan Harris < Ryan.Harris@zionsbancorp.com 
[Ryan.Harris@zionsbancorp.com] > wrote:
collect_list(col) will give you an array with all of the data from that 
column
However, the scalability of this approach will have limits.

-----Original Message-----
 From: mahender bigdata [mailto:Mahender.BigData@outlook.com]
Sent: Monday, March 28, 2016 5:47 PM
To: user@hive.apache.org
Subject: Best way of Unpivoting of hiva table data. Any Analytic function 
for unpivoting

Hi,

Has any one implemented Unpivoting of Hive external table data. We would
like Convert Columns into Multiple Rows. We have external table, which
holds almost 2 GB of Data. is there best and quicker way of Converting
columns into Row. Any Analytic functions available in Hive to do 
Unpivoting.



======================================================================
THIS ELECTRONIC MESSAGE, INCLUDING ANY ACCOMPANYING DOCUMENTS, IS 
CONFIDENTIAL and may contain information that is privileged and exempt from 
disclosure under applicable law. If you are neither the intended recipient 
nor responsible for delivering the message to the intended recipient, 
please note that any dissemination, distribution, copying or the taking of 
any action in reliance upon the message is strictly prohibited. If you have 
received this communication in error, please notify the sender immediately. 
Thank you.
Mime
View raw message