Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance 使用IN子句参数并行执行配置单元查询_Performance_Hadoop_Hive_Query Optimization_Hiveql - Fatal编程技术网

Performance 使用IN子句参数并行执行配置单元查询

Performance 使用IN子句参数并行执行配置单元查询,performance,hadoop,hive,query-optimization,hiveql,Performance,Hadoop,Hive,Query Optimization,Hiveql,我有一个蜂巢查询,如下所示: select a.x as column from table1 a where a.y in (<long comma-separated list of parameters>) union all select b.x as column from table2 b where b.y in (<long comma-separated list of parameters>) 我已将hive.exec.parallel设置为true

我有一个蜂巢查询,如下所示:

select a.x as column from table1 a where a.y in (<long comma-separated list of parameters>)
union all
select b.x as column from table2 b where b.y in (<long comma-separated list of parameters>)
我已将hive.exec.parallel设置为true,这有助于我在union all之间的两个查询之间实现并行性

但是,我的IN子句有许多逗号分隔的值,每个值在一个作业中取一次,然后取下一个值。这实际上是按顺序执行的

是否有任何配置单元参数(如果启用)可以帮助我并行获取in子句中参数的数据


目前,我的解决方案是使用=多次触发select查询,而不是在子句中触发一次查询。

不需要在单独的查询中多次读取相同的数据以实现更好的并行性。调整适当的映射器和减速器平行度

首先,通过矢量化启用PPD,使用CBO和Tez:

SET hive.optimize.ppd=true;
SET hive.optimize.ppd.storage=true;
SET hive.vectorized.execution.enabled=true;
SET hive.vectorized.execution.reduce.enabled = true;
SET hive.cbo.enable=true;
set hive.stats.autogather=true;
set hive.compute.query.using.stats=true;
set hive.stats.fetch.partition.stats=true;
set hive.execution.engine=tez;
SET hive.stats.fetch.column.stats=true;
SET hive.tez.auto.reducer.parallelism=true; 
Tez上地图绘制者的设置示例:

set hive.input.format=org.apache.hadoop.hive.ql.io.HiveInputFormat;
set tez.grouping.max-size=32000000;
set tez.grouping.min-size=32000;
如果您决定在MR而不是Tez上运行,则映射程序的示例设置:

set mapreduce.input.fileinputformat.split.minsize=32000; 
set mapreduce.input.fileinputformat.split.maxsize=32000000; 
-减速器的示例设置:

set hive.exec.reducers.bytes.per.reducer=32000000; --decrease this to increase the number of reducers, increase to reduce parallelism
播放这些设置。成功的标准是有更多的映射器/还原器,你的映射和还原阶段运行得更快


阅读本文以更好地了解如何调整Tez:

感谢您的回答。无法使用hive.vectorized.execution.enabled,因为我的数据不是ORC格式。它是Avro格式的。检查hive.cbo.enable无法使用,因为我知道Cloudera 5.3.3中没有配置单元版本0.13.1Tez:@vijayinani使用MR的映射器设置。对于Tez和MR.@leftjoin来说,reducer的配置都是有效的。感谢您的回答,我正在运行查询以删除重复的2.4亿条记录,有没有办法决定我们应该为-mapreduce.input.fileinputformat.split.maxsize和hive.exec.reducers.bytes.per.reducer使用什么值