【发布时间】:2019-07-21 17:07:48
【问题描述】:
尝试在 AWS Amazon 集群上运行我的程序时。
[hadoop@ip-172-31-5-232 ~]$ spark-submit 6.py .
我收到以下错误:
Exception: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transformation. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063.
这是我出现错误的代码示例:
result= l.map(lambda x : (x[0], list(x[1]))).collect()
if (NbrVertex > (2*(len(filteredResults.collect())+ ExtSimilarity))):
Successor=filteredResults3.map(lambda j:matchedSuccessor(j,result))
print(Successor.collect())
你可以看下图]1
【问题讨论】:
-
如果你能粘贴你的代码就很容易了
-
这个答案有帮助吗?
标签: amazon-web-services apache-spark amazon-s3 amazon-ec2 aws-lambda