gpt4 book ai didi

hadoop - hadoop 中连接表的问题,其中驱动程序表有 1000 万条记录,而子表左连接有 100 万条记录

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

在连接 hadoop 中的 3 个表时遇到问题,其中最左边的表有 10M 条记录,每个右边的表有 1M 条记录。最右边的表与父表左连接。

SELECT distinct Table1.cid,Table2.gdtyp,Table3.ager,Table3.edcd FROM (SELECT 
distinct(cid) FROM Table1 WHERE Table1.orgcd='T002' AND
(Table1.cacttrdt>=19980101 AND Table1.cacttrdt<=20171120) limit 2) Table1
LEFT JOIN Table2 Table2 ON (Table2.cid=Table1.cid) LEFT JOIN Table3 Table3
ON (Table3.cid=Table1.cid)

上述查询在 mapreduce 期间卡住了。已将 auto convert join 设置为 false。

最佳答案

矢量化查询执行提高了连接、扫描、聚合和过滤等操作的性能,方法是一次批量执行 1024 行,而不是每次执行一行。

在 Hive 0.13 中引入,此功能显着缩短了查询执行时间,并且可以通过两个参数设置轻松启用:

设置 hive.vectorized.execution.enabled = true;设置 hive.vectorized.execution.reduce.enabled = true;

除了Mapreduce之外,还使用TEZ作为执行引擎。

关于hadoop - hadoop 中连接表的问题,其中驱动程序表有 1000 万条记录,而子表左连接有 100 万条记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47506190/

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