2017-03-27 143 views
0

我将我的配置单元表以HDFS格式存储为Parquet格式。我可以将此位置的镶木地板文件转换为序列文件格式并在其上构建配置表格吗? 是否有任何程序可以执行此转换?将Parquet文件格式转换为序列文件格式

+0

为什么........? ... –

+0

@DuduMarkovitz我公司的其他一些团队希望将数据作为序列文件格式。 –

回答

1

创建新的序列文件表,并使用插入选择重新加载数据:

insert into sequence_table 
select * from parquet_table; 
+0

让我试试看。谢谢。 –

+0

如果我的序列表按年,月,日分区,那么我如何从我的镶木地板表中插入由年,月,日划分的所有记录,因为它是我的序列表中的记录? –

+0

创建分区表,'插入覆盖表sequence_table分区(年,月,日)从实木复合地板表中选择,分区键应该是最后一个,通过分区键添加分配来减少压缩机的压力。如果目标表具有完全相同的结构,则可以选择*。 – leftjoin

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 
; 
+0

如果我的序列表按年份,月份,日期分区,那么如何插入我的镶木地板表中按年,月,日分区的所有记录,因为它是我的序列表中的数据?只要插入? –

+0

安迪,看到更新的答案。 –

相关问题