<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Hive External table for  Hbase  can we create in a compressed way? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-External-table-for-Hbase-can-we-create-in-a-compressed/m-p/209893#M69292</link>
    <description>&lt;P&gt;Hi  &lt;A rel="user" href="https://community.cloudera.com/users/39249/gayathrimtechcse.html" nodeid="39249"&gt;@Gayathri Devi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You don't have to mention any compression format property in &lt;STRONG&gt;create Hive table statement.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Because hive is just pointing to &lt;STRONG&gt;HBase table,&lt;/STRONG&gt; if &lt;STRONG&gt;HBase table&lt;/STRONG&gt; is &lt;STRONG&gt;compressed&lt;/STRONG&gt; then&lt;STRONG&gt; Hive automatically&lt;/STRONG&gt; picks up the &lt;STRONG&gt;compression&lt;/STRONG&gt; format by &lt;STRONG&gt;default&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Just create table statement&lt;STRONG&gt; without compression&lt;/STRONG&gt; formats property like below,&lt;/P&gt;&lt;PRE&gt;CREATE EXTERNAL TABLE tablename(hbid string,Mvdouble, COUNTRY string) ROW FORMAT SERDE 'org.apache.hadoop.hive.hbase.HBaseSerDe' STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping"=":key,RAW:Mv,RAW:COUNTRY") TBLPROPERTIES ("hbase.table.name"="tblname");&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Example:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;i have created a &lt;STRONG&gt;HBase table&lt;/STRONG&gt; with &lt;STRONG&gt;snappy &lt;/STRONG&gt;compression and i put 3 records to it then scanned the table.&lt;/P&gt;&lt;PRE&gt;hbase(main)#create 'tbl_snp', { NAME =&amp;gt; 'cf', COMPRESSION =&amp;gt; 'SNAPPY' }
hbase(main)#put 'tbl_snp','1','cf:name','hcc'
hbase(main)#put 'tbl_snp','2','cf:name','hdp'
hbase(main)#put 'tbl_snp','3','cf:name','hdf'
hbase(main)#scan 'tbl_snp' 
ROW                                               COLUMN+CELL
 1                                                column=cf:name, timestamp=1507641820083, value=hcc
 2                                                column=cf:name, timestamp=1507641848288, value=hdp
 3                                                column=cf:name, timestamp=1507641855165, value=hdf
3 row(s) in 0.0190 seconds&lt;/PRE&gt;&lt;P&gt;Then i have created &lt;STRONG&gt;Hive table without&lt;/STRONG&gt; &lt;STRONG&gt;compression&lt;/STRONG&gt; property in the statement on &lt;STRONG&gt;top&lt;/STRONG&gt; of &lt;STRONG&gt;HBase tbl_snp&lt;/STRONG&gt; table&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Create Table Statement:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;create external table default.tbl_snp(id int, name string)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES 
("hbase.columns.mapping"=":key,cf:name") TBLPROPERTIES ("hbase.table.name"="tbl_snp");&lt;/PRE&gt;&lt;PRE&gt;select * from default.tbl_snp;
+-------------+---------------+--+
| tbl_snp.id  | tbl_snp.name  |
+-------------+---------------+--+
| 1           | hcc           |
| 2           | hdp           |
| 3           | hdf           |
+-------------+---------------+--+
3 rows selected (0.876 seconds)&lt;/PRE&gt;&lt;P&gt;i did select from &lt;STRONG&gt;Hive table&lt;/STRONG&gt; and we got &lt;STRONG&gt;all&lt;/STRONG&gt; the&lt;STRONG&gt; records&lt;/STRONG&gt; that &lt;STRONG&gt;existed&lt;/STRONG&gt; in the&lt;STRONG&gt; HBase&lt;/STRONG&gt; table, as i have &lt;STRONG&gt;created Hive table without compression property.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 20:38:58 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2017-10-10T20:38:58Z</dc:date>
    <item>
      <title>Hive External table for  Hbase  can we create in a compressed way?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-External-table-for-Hbase-can-we-create-in-a-compressed/m-p/209892#M69291</link>
      <description />
      <pubDate>Tue, 10 Oct 2017 16:00:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-External-table-for-Hbase-can-we-create-in-a-compressed/m-p/209892#M69291</guid>
      <dc:creator>Gayathridevi</dc:creator>
      <dc:date>2017-10-10T16:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Hive External table for  Hbase  can we create in a compressed way?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-External-table-for-Hbase-can-we-create-in-a-compressed/m-p/209893#M69292</link>
      <description>&lt;P&gt;Hi  &lt;A rel="user" href="https://community.cloudera.com/users/39249/gayathrimtechcse.html" nodeid="39249"&gt;@Gayathri Devi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You don't have to mention any compression format property in &lt;STRONG&gt;create Hive table statement.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Because hive is just pointing to &lt;STRONG&gt;HBase table,&lt;/STRONG&gt; if &lt;STRONG&gt;HBase table&lt;/STRONG&gt; is &lt;STRONG&gt;compressed&lt;/STRONG&gt; then&lt;STRONG&gt; Hive automatically&lt;/STRONG&gt; picks up the &lt;STRONG&gt;compression&lt;/STRONG&gt; format by &lt;STRONG&gt;default&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Just create table statement&lt;STRONG&gt; without compression&lt;/STRONG&gt; formats property like below,&lt;/P&gt;&lt;PRE&gt;CREATE EXTERNAL TABLE tablename(hbid string,Mvdouble, COUNTRY string) ROW FORMAT SERDE 'org.apache.hadoop.hive.hbase.HBaseSerDe' STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping"=":key,RAW:Mv,RAW:COUNTRY") TBLPROPERTIES ("hbase.table.name"="tblname");&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Example:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;i have created a &lt;STRONG&gt;HBase table&lt;/STRONG&gt; with &lt;STRONG&gt;snappy &lt;/STRONG&gt;compression and i put 3 records to it then scanned the table.&lt;/P&gt;&lt;PRE&gt;hbase(main)#create 'tbl_snp', { NAME =&amp;gt; 'cf', COMPRESSION =&amp;gt; 'SNAPPY' }
hbase(main)#put 'tbl_snp','1','cf:name','hcc'
hbase(main)#put 'tbl_snp','2','cf:name','hdp'
hbase(main)#put 'tbl_snp','3','cf:name','hdf'
hbase(main)#scan 'tbl_snp' 
ROW                                               COLUMN+CELL
 1                                                column=cf:name, timestamp=1507641820083, value=hcc
 2                                                column=cf:name, timestamp=1507641848288, value=hdp
 3                                                column=cf:name, timestamp=1507641855165, value=hdf
3 row(s) in 0.0190 seconds&lt;/PRE&gt;&lt;P&gt;Then i have created &lt;STRONG&gt;Hive table without&lt;/STRONG&gt; &lt;STRONG&gt;compression&lt;/STRONG&gt; property in the statement on &lt;STRONG&gt;top&lt;/STRONG&gt; of &lt;STRONG&gt;HBase tbl_snp&lt;/STRONG&gt; table&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Create Table Statement:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;create external table default.tbl_snp(id int, name string)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES 
("hbase.columns.mapping"=":key,cf:name") TBLPROPERTIES ("hbase.table.name"="tbl_snp");&lt;/PRE&gt;&lt;PRE&gt;select * from default.tbl_snp;
+-------------+---------------+--+
| tbl_snp.id  | tbl_snp.name  |
+-------------+---------------+--+
| 1           | hcc           |
| 2           | hdp           |
| 3           | hdf           |
+-------------+---------------+--+
3 rows selected (0.876 seconds)&lt;/PRE&gt;&lt;P&gt;i did select from &lt;STRONG&gt;Hive table&lt;/STRONG&gt; and we got &lt;STRONG&gt;all&lt;/STRONG&gt; the&lt;STRONG&gt; records&lt;/STRONG&gt; that &lt;STRONG&gt;existed&lt;/STRONG&gt; in the&lt;STRONG&gt; HBase&lt;/STRONG&gt; table, as i have &lt;STRONG&gt;created Hive table without compression property.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 20:38:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-External-table-for-Hbase-can-we-create-in-a-compressed/m-p/209893#M69292</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2017-10-10T20:38:58Z</dc:date>
    </item>
  </channel>
</rss>

