gpt4 book ai didi

apache-spark - 如何在 "force"Hive on Spark 中使用 Map Join?

转载 作者:可可西里 更新时间:2023-11-01 15:19:27 24 4
gpt4 key购买 nike

Hive on Spark 不使用 Map-Join 查询 View ,该 View 对多个表进行联合。

当使用 MR 引擎进行相同的查询时,使用 Map-Join。

我尝试按照 Cloudera 的建议设置各种 Spark 设置 - https://www.cloudera.com/documentation/enterprise/5-13-x/topics/admin_hos_oview.html#dpp_in_hos

我使用的 View 是一些表的简单联合,这些表都具有相同的结构并已分区。

View 是这样创建的:

create view myView
as
select * from tbl1
union all
select * from tbl2
union all
select * from tbl3
union all
select * from tbl4

我正在运行的 HQL 查询有一个“where 子句”,其中需要进行分区访问。 HoS 没有意识到这一点,而 HoMR 利用分区和 Map-Join。

当前使用 Hive 1.1(建议升级与 atm 无关)

谢谢

最佳答案

this Cloudera doc 中所述,以下设置对 Hive On Spark 中的 MapJoin 行为有直接影响:

...hive.auto.convert.join.noconditionaltask.size, which is the threshold for converting common join to map join based on statistics, can have a significant performance impact. Although this configuration is used for both Hive on MapReduce and Hive on Spark, it is interpreted differently by each.

The size of data is described by two statistics:

  • totalSize - Approximate size of data on disk
  • rawDataSize - Approximate size of data in memory

Hive on MapReduce uses totalSize. When both are available, Hive on Spark uses rawDataSize. Because of compression and serialization, a large difference between totalSize and rawDataSize can occur for the same dataset. For Hive on Spark, you might need to specify a larger value for hive.auto.convert.join.noconditionaltask.size to convert the same join to a map join.

请查看这是否适用于您的情况。

由于我们没有看到您的查询,我不确定动态分区修剪(在您的链接中引用)与您的 MapJoin 问题有何关系。

关于apache-spark - 如何在 "force"Hive on Spark 中使用 Map Join?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57476558/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com