hive 儲存格式

2022-04-10 10:39:08 字數 1030 閱讀 9422

hive有textfile,sequencefile,rcfile三種檔案格式。

textfile為預設格式,建表時不指定預設為這個格式,匯入資料時會直接把資料檔案拷貝到hdfs上不進行處理。

sequencefile,rcfile格式的表不能直接從本地檔案匯入資料,資料要先匯入到textfile格式的表中,

然後再從textfile表中用insert匯入到sequencefile,rcfile表中。

create table zone0000tf(ra int, dec int, mag int) row format delimited fields terminated by '|';

create table zone0000rc(ra int, dec int, mag int) row format delimited fields

terminated by '|' stored as rcfile;

load data local inpath '/home/cq/usnoa/zone0000.asc ' into table zone0000tf;

insert overwrite table zone0000rc select * from zone0000tf;(begin a job)

file format

textfile

sequencefile

rcffile

data type

text only

text/binary

text/binary

internal storage order

row-based

row-based

column-based

compression

file based

block based

block based

splitable

yesyes

yes

splitable after compression

noyes

yes

hive儲存格式

textfile 預設格式,行儲存,匯入資料時直接把資料檔案拷貝到hdfs的hive表目錄 hive location 資料檔案可先經過gzip等壓縮,再導hive表 系統自動檢查,執行查詢時自動解壓 但使用這種方式,hive不會對資料進行切分,從而無法對資料進行並行操作.優點 資料載入快 load...

Hive儲存格式

hive的四種儲存格式 textfile sequencefile rcfile parquet 列式儲存和行式儲存的比較 優點缺點 行式儲存 一行資料是一條記錄,放在同乙個block塊中 只查詢幾個列時,也會讀取整行的資料,當資料量大時,影響效能 方便進行insert update操作 不同型別的...

HIVE檔案儲存格式

hive檔案儲存格式包括以下幾類 textfile sequencefile rcfile orcfile 其中textfile為預設格式,建表時不指定預設為這個格式,匯入資料時會直接把資料檔案拷貝到hdfs上不進行處理。sequencefile,rcfile,orcfile格式的表不能直接從本地檔...