title: Insert data into Hbase using Hive (JSON file)
body: <p>I have already created a table in hbase using hive:</p>
  
  <pre><code>hive&gt; CREATE TABLE hbase_table_emp(id int, name string, role string) 
  STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
  WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf1:name,cf1:role")
  TBLPROPERTIES ("hbase.table.name" = "emp");
  </code></pre>
  
  <p>and created another table to load data on it :</p>
  
  <pre><code>hive&gt; create table testemp(id int, name string, role string) row format delimited fields terminated by '\t';
  hive&gt; load data local inpath '/home/user/sample.txt' into table testemp;
  </code></pre>
  
  <p>and finally insert data into the hbase table:</p>
  
  <pre><code>hive&gt; insert overwrite table hbase_table_emp select * from testemp;
  hive&gt; select * from hbase_table_emp;
  OK
  123 Ram     TeamLead
  456 Silva   Member
  789 Krishna Member
  time taken: 0.160 seconds, Fetched: 3 row(s)
  </code></pre>
  
  <p>the table looks like this in hbase:</p>
  
  <pre><code>hbase(main):002:0&gt; scan 'emp'
  ROW                   COLUMN+CELL                                               
   123                  column=cf1:name, timestamp=1422540225254, value=Ram       
   123                  column=cf1:role, timestamp=1422540225254, value=TeamLead  
   456                  column=cf1:name, timestamp=1422540225254, value=Silva     
   456                  column=cf1:role, timestamp=1422540225254, value=Member    
   789                  column=cf1:name, timestamp=1422540225254, value=Krishna      
   789                  column=cf1:role, timestamp=1422540225254, value=Member    
  3 row(s) in 2.1230 seconds
  </code></pre>
  
  <p>Can I do the same for a JSON file :</p>
  
  <pre><code> {"id": 123, "name": "Ram", "role":"TeamLead"}
   {"id": 456, "name": "Silva", "role":"Member"}
   {"id": 789, "name": "Krishna", "role":"Member"}
  </code></pre>
  
  <p>and do :</p>
  
  <pre><code>hive&gt; load data local inpath '/home/user/sample.json' into table testemp;
  </code></pre>
  
  <p>please Help ! :)</p>