我从配置单元CLI运行了以下查询。查询运行了很长一段时间,之后就失败了。
SET hive.tez.container.size=10240;
SET hive.tez.java.opts=-Xmx8192m;
set tez.runtime.io.sort.mb=4096;
set tez.runtime.unordered.output.buffer.size-mb=1024;
set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;
set hive.vectorized.execution.reduce.enabled;
set hive.execution.engine=tez;
SELECT
cust_his.cname AS cname
,cust_his.creg AS creg
,Upper(Trim(cust_his.ccountry)) AS ccountry
,Upper(Trim(cust_his.cloc)) AS cloc
FROM
customer_history cust_his
WHERE
cust_his.cust_d BETWEEN 20160501 AND 20160531
AND Substr(Trim(cust_his.cloc), 1, Locate('|', cust_his.cloc, 1) - 1) <> ''
AND Substr(Trim(cust_his.cloc), 1, Locate('|', cust_his.cloc, 1) - 1) IS NOT NULL
AND cast(Trim(cust_his.cmfid) as int) NOT IN ( 1,2,3 )
AND cust_his.cmat = '8';该表按cust_d列进行分区。该表有420TB的数据。
请帮我解决这个问题。
提前谢谢。
发布于 2017-03-15 03:43:04
您的查询只能在映射器上运行,因为没有group by或join或文件合并。
检查有多少映射器启动,分区修剪是否有效,检查查询计划。如果分区修剪不起作用,试着用>=和<=替换BETWEEN条件,有时它会有帮助,向量化执行可能不支持你的版本中的BETWEEN,根据这个:https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0/bk_dataintegration/content/query-vectorization.html。
还要加上这个:设置hive.vectorized.execution.enabled = true;
这个条件也是多余的:
AND Substr(Trim(cust_his.cloc), 1, Locate('|', cust_his.cloc, 1) - 1) IS NOT NULL您不需要它,因为您已经具有相同的<> '',这将自动排除nulls
https://stackoverflow.com/questions/42794877
复制相似问题