Exception: Randomness of hash of string should be disabled via PYTHONHASHSEED

pyspark提交任务报错:

Exception: Randomness of hash of string should be disabled via PYTHONHASHSEED

解决方案:

1. os.environ['PYTHONHASHSEED'] = "123" —— 失败,该方案改动小,但是未能解决问题。

2. 在spark配置文件夹conf中,找到spark-defaults.conf并加入:spark.executorEnv.PYTHONHASHSEED=0  —— 尚未尝试,因为这个对集群有修改。

3. 执行任务时加入:--conf spark.executorEnv.PYTHONHASHSEED=321

例如:

spark-submit --conf spark.executorEnv.PYTHONHASHSEED=321 xxx.py

本人尝试成功的是第3种方法。

#

参考:

https://blog.csdn.net/qq_37181642/article/details/102552180

https://blog.csdn.net/ncutits/article/details/81394692

原文地址:https://www.cnblogs.com/qi-yuan-008/p/13655898.html