【发布时间】:2020-04-14 11:01:46
【问题描述】:
我正在使用 spark 加入从天蓝色存储获取的静态数据集和从 eventthub 获取的流数据集。我没有在任何地方使用广播加入。加入后我尝试了 df.explain() ,它显示正在发生 sortmerge 加入。我不确定为什么会收到与广播哈希连接相关的错误。
java.lang.OutOfMemoryError: Not enough memory to build and broadcast the table to all worker nodes. As a workaround, you can either disable broadcast by setting spark.sql.autoBroadcastJoinThreshold to -1 or increase the spark driver memory by setting spark.driver.memory to a higher value
...
...
Exception in thread "spark-listener-group-shared" java.lang.OutOfMemoryError: Java heap space
...
...
spark 是否广播它从事件中心获得的所有内容?
这就是我的程序的样子
//##read stream from event hub
process(stream)
def process(stream: DataFrame){
val firstDataSet = getFirstDataSet()
firstDataSet.persist()
val joined = stream.join(
firstDataSet,
stream("joinId") === firstDataSet("joinId")
)
//##write joined to event hub
}
def getFirstDataSet(){
//##read first from azure storage
val firstDataSet = first.filter(
condition1 &&
condition 2
)
}
更新:看起来像 JVM Out of Memory 错误,与广播无关。 https://issues.apache.org/jira/plugins/servlet/mobile#issue/SPARK-24912
我尝试使用 gceasy.io 在 GC 后检查驱动程序和执行程序堆的使用情况: 执行者看起来不错 GC 后的驱动程序内存消耗看起来不断增加
看起来 char 数组正在累积在驱动程序中。我不确定是什么导致它累积 char 数组。
【问题讨论】:
-
评论不用于扩展讨论;这个对话是moved to chat。
标签: apache-spark broadcast spark-structured-streaming azure-eventhub