1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| 先不使用压缩,创建一个SequenceFile存储格式的表。 注意:在这需要使用stored as指定sequencefile存储格式,不指定的话默认是textfile。所以我们前面在创建表的时候其实都省略了这个配置。 create external table stu_seqfile_none_compress( id int, name string, city string )row format delimited fields terminated by ',' lines terminated by '\n' stored as sequencefile location 'hdfs://bigdata01:9000/stu_seqfile_none_compress';
确认一下这个表: hive (default)> show create table stu_seqfile_none_compress; OK createtab_stmt CREATE EXTERNAL TABLE `stu_seqfile_none_compress`( `id` int, `name` string, `city` string) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' WITH SERDEPROPERTIES ( 'field.delim'=',', 'line.delim'='\n', 'serialization.format'=',') STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.SequenceFileInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat' LOCATION 'hdfs://bigdata01:9000/stu_seqfile_none_compress' TBLPROPERTIES ( 'bucketing_version'='2', 'transient_lastDdlTime'='1819270622') Time taken: 0.082 seconds, Fetched: 19 row(s)
|