在Spark Python中初始化SQLContext错误

时间:2018-12-16 13:06:43

标签: apache-spark pyspark mysql-connector

如果有人早些时候遇到了这个问题,请告诉我,任何线索都将受到赞赏

运行脚本中的异常调用o40.load时发生错误。

:java.lang.NoSuchMethodError:org.apache.spark.sql.SQLContext.sparkSession()Lorg / apache / spark / sql / SparkSession;

at com.mongodb.spark.sql.DefaultSource.createRelation(DefaultSource.scala:66)

at com.mongodb.spark.sql.DefaultSource.createRelation(DefaultSource.scala:50)

at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.apply(ResolvedDataSource.scala:158)

at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:119)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231)

at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:381)

at py4j.Gateway.invoke(Gateway.java:259)

at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:133)

at py4j.commands.CallCommand.execute(CallCommand.java:79)

at py4j.GatewayConnection.run(GatewayConnection.java:209)

at java.lang.Thread.run(Thread.java:745)

0 个答案:

没有答案