Hive 沒有 not in 解決方案

2021-07-13 11:13:17 字數 635 閱讀 5635

hive 裡面沒有 not in ,where 查詢時候可以 使用left outer join

dpods_wfa_processhistory 表結構

需要查詢 param不為 『協議被駁回&』 的processid max(addtime),

因為where不能使用not in,下面sql將bb表新增a欄位,值為1(param值為 協議被駁回&)然後左外連線時,空值為取出的值。

select processid,

max(addtime) as addtime

from dpods_wfa_processhistory cc

left outer join

(select distinct processid as procid,

1 as a

from dpods_wfa_processhistory

where param = 『協議被駁回&』) bb on cc.processid = bb.procid

where bb.a is null

group by processid

if 沒有解決方案

c if 沒有 c else 可以用 c choose 來取代結構 c choose c when test 如果 c when c otherwise 否則 c otherwise c choose 在同乙個 c choose 中,當所有 c when 的條件都沒有成立時,則執行 c otherw...

HIVE優化 解決方案

1.開啟並行引數 set hive.exec.parallel true set hive.exec.parallel.thread.number 16 同乙個sql允許最大並行度,預設為8 2.負載均衡引數 只針對groupby操作的傾斜 set hive.groupby.skewindata t...

關於 if 沒有解決方案

c if 沒有 c else 可以用 c choose 來取代結構 c choose c when test 如果 c when c otherwise 否則 c otherwise c choose 在同乙個 c choose 中,當所有 c when 的條件都沒有成立時,則執行 c otherw...