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

nwsw7zdq  于 2021-06-26  发布在  Hive
关注(0)|答案(2)|浏览(358)

我的配置单元表以Parquet格式存储在hdfs中的某个位置。我可以将此位置的Parquet文件转换为序列文件格式并在其上构建配置单元表吗?是否有任何程序来进行转换?

g52tjvyc

g52tjvyc1#

创建新的序列文件表并使用insert select重新加载数据:

insert into sequence_table
select * from parquet_table;
3ks5zfa0

3ks5zfa02#

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
;

相关问题