[英]How to disable broadcast in a Databricks notebook?
當我在 Databricks/PySpark 中運行查詢時,出現以下錯誤:
org.apache.spark.SparkException: Could not execute broadcast in 300 secs. You can increase the timeout for broadcasts via spark.sql.broadcastTimeout or disable broadcast join by setting spark.sql.autoBroadcastJoinThreshold to -1
如何在 Databricks 筆記本中以編程方式 (Python) 執行此操作? 我嘗試了以下方法:
>>> spark.sql.autoBroadcastJoinThreshold(-1)
result:
AttributeError: 'function' object has no attribute 'autoBroadcastJoinThreshold'
>>> spark.sql.autoBroadcastJoinThreshold = -1
result:
AttributeError: 'method' object has no attribute 'autoBroadcastJoinThreshold'
也許spark.sql.autoBroadcastJoinThreshold
是一個屬性鍵,這個屬性可以以某種方式設置為 -1,但我還沒有找到任何描述如何使用 Python 完成此操作的文檔。
我在加入命令之前在 databricks 中使用了它並且它有效:
spark.conf.set("spark.sql.broadcastTimeout" ,"-1")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.