hive動態分割槽

2021-07-16 23:29:43 字數 1341 閱讀 8735

不需要為不同的分割槽新增不同的插入語句

分割槽不確定,需要從資料中獲取

幾個引數:

set hive.exec

.dynamic

.partition=true//使用動態分割槽

set hive.exec

.dynamic

.partition

.mode=nonstrick//無限制模式,如果模式是strict,則必須有乙個靜態分割槽,切放在最前面

set hive.exec

.max

.dynamic

.partitions

.pernode=10000//每個節點生成動態分割槽的最大個數

set hive.exec

.max

.dynamic

.partitions=100000//生成動態分割槽的最大個數

set hive.exec

.max

.created

.files=150000//乙個任務最多可以建立的檔案數目

set dfs.datanode

.max

.xcievres=9182//限定一次最多開啟的檔案數

create

table d_part(

name string

)partitioned by (value string)

row format delimited fields terminated by

'\t' lines terminated by

'\n' stored as textfile;

set hive.exec.dynamic.partition=true;

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

insert overwrite table d_part partition(value)

select name,addr as

value

from somtable;

將addr作為分割槽字段插入

多個字段分割槽

create

table d_part(

name string

)partitioned by (month string,day string)

row format delimited fields terminated by

'\t' lines terminated by

'\n' stored as textfile;

有靜態分割槽,靜態分割槽放在前面

HIVE動態分割槽

一 前段時間因為導表需求 從一張表中查詢出資料,按日期分割槽overwrite 到指定分割槽表中 在hive裡面研究了一下自動分割槽。步驟 1 建好所需分割槽表 2 設定分割槽引數?1 2 3 4 sethive.exec.dynamic.partition true 可通過這個語句檢視 sethi...

Hive動態分割槽

動態分割槽指不需要為不同的分割槽新增不同的插入語句,分割槽不確定,需要從資料中獲取。相關引數設定 set hive.exec dynamic partition true 使用動態分割槽 可通過這個語句檢視 set hive.exec dynamic partition set hive.exec ...

Hive動態分割槽

insert overwrite table part1 partition dt 2016 09 03 select from test datatest data表 idname 1liming 2jenny 3denny 上面 是往表的某乙個固定分割槽插入資料 但是當我們要插入的分割槽不確定的...