Hi Unmesha,

You can simply do
Hdfs dfs –cat /user/hive/warehouse/hivemb/delta_0000012_0000012/bucket_00000/*

And check the content of file.

Thanks
Somnath
From: unmesha sreeveni [mailto:unmeshab...@gmail.com]
Sent: Monday, December 01, 2014 10:31 AM
To: User - Hive
Subject: How to retriew data from a specific bucket in hive?


I created a table in hive
create table HiveMB
  (EmployeeID Int,FirstName String,Designation String,Salary Int,Department 
String)
   clustered by (Department) into 3 buckets
   stored as orc TBLPROPERTIES ('transactional'='true') ;

where my file format is like
1,Anne,Admin,50000,A
2,Gokul,Admin,50000,B
3,Janet,Sales,60000,A
4,Hari,Admin,50000,C
5,Sanker,Admin,50000,C

and the data went into 3 buckets for department.

When I examined the warehouse , there are 3 buckets
Found 3 items
-rwxr-xr-x   3 aibladmin hadoop     252330 2014-11-28 14:46 
/user/hive/warehouse/hivemb/delta_0000012_0000012/bucket_00000
-rwxr-xr-x   3 aibladmin hadoop     100421 2014-11-28 14:45 
/user/hive/warehouse/hivemb/delta_0000012_0000012/bucket_00001
-rwxr-xr-x   3 aibladmin hadoop     313047 2014-11-28 14:46 
/user/hive/warehouse/hivemb/delta_0000012_0000012/bucket_00002

How will I be able to retrieve 1 such bucket.

When I did a -cat, It is not in human readable format.
How can I able to see the data stored into each bucket?


--
Thanks & Regards

Unmesha Sreeveni U.B
Hadoop, Bigdata Developer
Centre for Cyber Security | Amrita Vishwa Vidyapeetham
http://www.unmeshasreeveni.blogspot.in/



**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not 
to copy, disclose, or distribute this e-mail or its contents to any other 
person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken 
every reasonable precaution to minimize this risk, but is not liable for any 
damage 
you may sustain as a result of any virus in this e-mail. You should carry out 
your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this 
e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

Reply via email to