赞
踩
A任务中关联一张表,该表经过过滤和去重,数据量小于10MB,实际任务耗时较长。
B任务关联一张小表,实际任务耗时较长
查看spark UIsql界面:
问题1:发现并没有走广播join
观察此处join,对于76条数据的表,估计的大小超过10M,实际76条数据大小小于spark.sql.autoBroadcastJoinThreshold的值,导致这个问题的原因在对于broadcast join的官方介绍中提到,
参数名 | 默认值 | 说明 |
---|---|---|
spark.sql.autoBroadcastJoinThreshold | 10485760 (10 MB) | Configures the maximum size in bytes for a table that will be broadcast to all worker nodes when performing a join. By setting this value to -1 broadcasting can be disabled. Note that currently statistics are only supported for Hive Metastore tables where the command ANALYZE TABLE COMPUTE STATISTICS noscan has been run. |
由于脚本中存在中间的计算,导致不能正确的估算表的大小,
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。