Pyspark python issue:Py4JJavaError: An error occurred while calling o59.classForName.

yashjain
Level 1
Pyspark python issue:Py4JJavaError: An error occurred while calling o59.classForName.

Hello everyone, I am working on PySpark and I have mentioned the code and getting some issue, I am wondering if someone knows about the following issue? I get the error in the last line of code.

mydataset = dataiku.Dataset(dataset name)
df = dkuspark.get_dataframe(sqlContext, mydataset)

Py4JJavaError: An error occurred while calling o59.classForName.
: java.lang.ClassNotFoundException: com.dataiku.dip.spark.StdDataikuSparkContext
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.apache.spark.util.Utils$.classForName(Utils.scala:218)
	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:244)
	at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
	at py4j.Gateway.invoke(Gateway.java:282)
	at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
	at py4j.commands.CallCommand.execute(CallCommand.java:79)
	at py4j.ClientServerConnection.waitForCommands(ClientServerConnection.java:182)
	at py4j.ClientServerConnection.run(ClientServerConnection.java:106)
	at java.lang.Thread.run(Thread.java:750)

 

Operating system - windows 

0 Kudos
1 Reply
AlexT
Dataiker

Hi @yashjain ,

It appears to be the same issue as described here:
https://community.dataiku.com/t5/Using-Dataiku/Read-as-Spark-dataframe/m-p/28110
The Spark integration is likely not correctly done.

Thanks

0 Kudos