Exception: Randomness of hash of string should be disabled via PYTHONHASHSEED
pyCharm执行程序执行到
movies_for_user = ratings.groupBy(lambda x:x.user).mapValues(list).lookup(789)
报错
Exception: Randomness of hash of string should be disabled via PYTHONHASHSEED
解决方法:
在运行py文件前加入环境变量如下:
os.environ[‘PYTHONHASHSEED’] = “123”
value值随便写即可
如果还不行,在spark配置文件spark-defaults.conf中加入:
spark.executorEnv.PYTHONHASHSEED=0
问题解决