HIVE運(yùn)行出錯(cuò):Error: Error while compiling statement: FAILED: SemanticException [Error 10226]: An addi...

WITH tmp as(

select

a.*,

if(b.guid is not null,null,a.guid) as nu? -- 是否新用戶的標(biāo)記:老用戶=null,新用戶=自己的guid

from

? (

? SELECT? * FROM dwd_apl_utm_dtl WHERE dt='2020-03-15'

? ) a?

? left join

? (

? ? SELECT * FROM dws_apl_hsu_rec WHERE dt='2020-03-15'

? ) b

? on a.guid=b.guid

)

INSERT INTO TABLE ads_apl_utm_ovw PARTITION(dt='2020-03-15')

SELECT

event['utm_source'],

event['utm_medium'],

event['utm_content'],

event['utm_campain'],

event['utm_term'],

count(1) as pv_cnts,

count(distinct sessionid) as se_cnts,

count(distinct guid) as uv_cnts,

count(distinct nu) as nu_cnts

FROM? tmp

group by? event['utm_source'],event['utm_medium'],event['utm_content'],event['utm_campain'],event['utm_term']

with cube;

Error: Error while compiling statement: FAILED: SemanticException [Error 10226]: An additional MR job is introduced since the cardinality of grouping sets is more than hive.new.job.grouping.set.cardinality. This functionality is not supported with distincts. Either set hive.new.job.grouping.set.cardinality to a high number (higher than the number of rows per input row due to grouping sets in the query), or rewrite the query to not use distincts. The number of rows per input row due to grouping sets is 32 (state=42000,code=10226)

因?yàn)橛玫??with cube

解決辦法:設(shè)置set hive.new.job.grouping.set.cardinality = 32

這個(gè)要設(shè)置的數(shù),要大于group by 組合和個(gè)數(shù),如這里,要組合5個(gè),所以 2^5=32,所以要設(shè)置大于等于32

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容