hive異常記錄

2021-08-19 20:00:35 字數 1390 閱讀 5036

1.hive mapjoin異常問題

摘要:hive被很廣泛的使用,使用過程中也會遇到各種千奇百怪的問題。這裡就遇到的mapjoin local 記憶體不足的問題進行討論,從問題描述、mapjion原理以及產生該問題的原因,解決方案做一下介紹,最後對該問題進行了進一步的思考,希望對解決該類問題的朋友有所幫助。

調小hive.smalltable.filesize,預設是25000000(在2.0.0版本中)

hive.mapjoin.localtask.max.memory.usage 調大到0.999

set hive.ignore.mapjoin.hint=false; 關閉忽略mapjoin的hints

double percentage = (double) usedmemory / (double) maxheapsize;

string msg = utilities.now() + "\tprocessing rows:\t" + numrows + "\thashtable size:\t"

+ tablecontainersize + "\tmemory usage:\t" + usedmemory + "\tpercentage:\t" + percentagenumberformat.format(percentage);

console.printinfo(msg);

if(percentage > maxmemoryusage)

jarcmd = hivejar + " " + execdriver.class.getname();

string hiveconfargs = execdriver.generatecmdline(conf, ctx);

string cmdline = hadoopexec + " jar " + jarcmd + " -localtask -plan " + planpath.tostring()

+ " " + issilent + " " + hiveconfargs;

...map variables = new hashmap(system.getenv());

...// run execdriver in another jvm

executor = runtime.getruntime().exec(cmdline, env, new file(workdir));

原因:空間不足

解決辦法:

在執行hive語句前加上

set mapreduce.map.memory.mb=1025;//只要大於1024,hive預設分配的記憶體分大一倍,也就是2048m  

set mapreduce.reduce.memory.mb=1025;

Hive使用記錄

hive新加字段 hive新增欄位後,如果是分割槽表,當前分割槽已經有資料時一定要先刪除分割槽後再插入資料,否則新加字段的值為null。alter table login drop if exists partition dt 2008 08 08 hive修改字段型別 alter table tm...

異常記錄 資料對比異常

業務邏輯中需要對比兩個物件是否是同乙個物件,不知道為什麼我去判斷兩個物件是否是同乙個物件,就用 去判斷兩個商品的id,然後id相等的時候返回給我乙個false,然後我嘗試用equals方法去判斷,然後就會返回乙個true,我想可能是因為我用了包裝型別integer型別的原因,測試了一下找到原因了,是...

android異常記錄

1.fragment not attached to activity 異常 原因 因為fragment在還沒有attach到acitivity時,呼叫了諸如getresource 方法 如 getresources getstring r.string.a 解決方案,在獲取資源之前呼叫isadde...