2017-03-27 145 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

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

相關問題