如何在Pyspark中设置KryoSerializer?

问题描述 投票:0回答:1

我是Pyspark的新手,请帮助我:

spark = SparkSession.builder.appName("FlightDelayRDD").master("local[*]").getOrCreate()
sc = spark.sparkContext
sc.setSystemProperty("spark.dynamicAllocation.enabled", "true")
sc.setSystemProperty("spark.dynamicAllocation.initialExecutors", "6")
sc.setSystemProperty("spark.dynamicAllocation.minExecutors", "6")
sc.setSystemProperty("spark.dynamicAllocation.schedulerBacklogTimeout", "0.5s")
sc.setSystemProperty("spark.speculation", "true")

我想像上面配置的那样在pyspark中设置KryoSerializer。

dataframe pyspark rdd
1个回答
0
投票

尝试使用:

sc.setSystemProperty("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
© www.soinside.com 2019 - 2024. All rights reserved.