报错:It appears that you are attempting to reference SparkContext from a broadcast variable, action
最新推荐文章于 2024-05-12 09:16:52 发布
本文介绍了遇到的Spark运行错误——尝试在广播变量、操作或转换中引用SparkContext。错误提示指出SparkContext只能在driver上使用,不能在worker上使用。文章分析了错误的原因,即在worker中使用了self.sc,并提供了修正代码的解决办法。
摘要由CSDN通过智能技术生成