将Parquet文件格式转换为序列文件格式

时间:2017-03-27 16:48:46

标签: hive parquet sequencefile

我将我的hive表存储为Parquet格式在HDFS中的某个位置。我可以将此位置的镶木地板文件转换为Sequence文件格式并在其上构建hive表吗? 是否有任何程序可以进行此转换?

2 个答案:

答案 0 :(得分:1)

使用insert select:

创建新的序列文件表并重新加载数据
insert into sequence_table
select * from parquet_table;

答案 1 :(得分:1)

hive> create table src (i int) stored as parquet;
OK
Time taken: 0.427 seconds
hive> create table trg stored as sequencefile as select * from src;

@AndyReddy

create table src (i int) 
partitioned by (year int,month tinyint,day tinyint)
stored as parquet
;

create table trg (i int) 
partitioned by (year int,month tinyint,day tinyint)
stored as sequencefile
;

set hive.exec.dynamic.partition.mode=nonstrict
;

insert into trg partition(year,month,day)
select * from src
;