title: HBase Hive Integration
body: <p>I have created a HBase by mentioning the default versions as 5</p>
  
  <p>create 'tablename',{NAME => 'cf', VERSIONS => 5}
  and inserted two rows(row1 and row2)</p>
  
  <pre><code>put 'tablename','row1','cf:id','row1id'
  put 'tablename','row1','cf:name','row1name'
  put 'tablename','row2','cf:id','row2id'
  put 'tablename','row2','cf:name','row2name'
  put 'tablename','row2','cf:name','row2nameupdate'
  put 'tablename','row2','cf:name','row2nameupdateagain'
  </code></pre>
  
  <p>Tried to select the data by using scan and I'm getting the latest updated data.
  and when I tried to select the different versions data by using the below command I got the different versions data.</p>
  
  <pre><code>scan 'tablename',{RAW =&gt; true, VERSIONS =&gt; 5}
  </code></pre>
  
  <p>Now created a Hive External table to point to this HBase table</p>
  
  <pre><code>CREATE EXTERNAL TABLE hive_timestampupdate(key int, value string)
  STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
  WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf:name")
  TBLPROPERTIES ("hbase.table.name" = "tablename");
  
  select * from hive_timestampupdate
  </code></pre>
  
  <p>When I queried the table hive_timestampupdate, I'm able to see the data.</p>
  
  <p>By default here I'm getting the latest updated data based on timestamp. 
  Here also I want to query the data of different versions.</p>
  
  <p><strong>Hive command that will fetch the different versions data of HBase.</strong></p>
  
  <p>Any help please.</p>
  
  <p>Thanks in Advance.</p>