title: How to retrieve data from a specific bucket in hive
body: <p>I created a table in hive</p>
  
  <pre><code>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') ;
  </code></pre>
  
  <p>where my file format is like</p>
  
  <pre><code>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
  </code></pre>
  
  <p>and the data went into 3 buckets for department.</p>
  
  <p>When I examined the warehouse , there are 3 buckets</p>
  
  <pre><code>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
  </code></pre>
  
  <p>How will I be able to retrieve 1 such bucket.</p>
  
  <p>When I did a <code>-cat</code>, It is not in human readable format.
  showing something like</p>
  
  <pre><code>`J�ǉ�(��rwNj��[��Y���gR�� \�B�Q_Js)�6 �st�A�6�ixt� R �
  ޜ�KT� e����IL Iԋ� ł2�2���I�Y��FC8 /2�g� ����� &gt; ������q�D � b�` `�`���89$ $$ ����I��y|@޿    
                                                                                                  %\���� �&amp;�ɢ`a~ � S �$�l�:y���K $�$����X�X��)Ě���U*��
  6.  �� �cJnf� KHjr�ć����� ��(p` ��˻_1s  �5ps1:  1:I4L\��u
  </code></pre>
  
  <p>How can I able to see the data stored into each bucket? </p>
  
  <p>And my file is in csv format not ORC so as a workaround I did <a href="https://stackoverflow.com/questions/21721251/loading-data-from-a-txt-file-to-table-stored-as-orc-in-hive">this</a></p>
  
  <p>But I am not able to view data in buckets. That is not in human readable format.</p>