spark.conf.set(“ spark.driver.maxResultSize”,'6g')未更新默认值-PySpark

时间:2020-07-15 02:17:16

标签: apache-spark pyspark azure-databricks

我正在尝试将spark.driver.maxResultSize值更新为6g,但是该值没有得到更新。

local button = script.Parent
local toggled = false
local guiObj = nil -- Replace nil with a reference to the "ScreenGui/BillboardGUI" object that houses the 'button'.

local function onButtonActivated()
    if toggled == false then
        --[[button.Text = "Game Loading..."
        toggled = true]]--
        guiObj:Destroy()
    else
        button.Text = "Start Game"
        toggled = false
    end
end

button.Activated:Connect(onButtonActivated)

注意:我正在Azure Databricks Notebook中运行此命令。

3 个答案:

答案 0 :(得分:2)

Spark 2.0 + 中,您应该能够使用SparkSession.conf.set方法在运行时设置一些配置选项,但是它主要限于SQL配置。由于您尝试更新conf中的spark.driver,因此需要使用新的SparkSession.builder.getOrCreate(如果正在运行)进行conf新会话。如:

import pyspark

sc = spark.sparkContext
conf = pyspark.SparkConf().setAll([("spark.driver.maxResultSize", '6g')])

# here you stop the old spark context with old conf
sc.stop()
sc = pyspark.SparkContext(conf=conf)

或者,您可以仅使用预定义的配置getOrCreate进行新会话,例如从YAML文件或从代码。然后,您可以使用

自己检查新的conf
sc.getConf().getAll()

答案 1 :(得分:1)

您在单配额中使用了不正确的值声明,它应该是双引号。

spark.conf.set("spark.driver.maxResultSize", '6g') 

请务必将其更改为:

spark.conf.set("spark.driver.maxResultSize", "6g")

enter image description here

答案 2 :(得分:0)

您可以尝试查看驱动程序的当前最大大小

sqlContext.getConf("spark.driver.maxResultSize")

它给出的当前最大存储容量为20 GB

现在,要增加:要增加maxResultSize,可以使用上面的命令。

但是不建议增加驱动程序容量

sqlContext.setConf("spark.driver.maxResultSize","30g")
相关问题