org.apache.spark.SparkException: Data of type [Ljava.lang.Object; cannot be used

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by user3827333
, 1 year ago
Data of type [Ljava.lang.Object; cannot be used
org.apache.spark.SparkException: Data of type [Ljava.lang.Object; cannot be used
at org.apache.spark.api.python.JavaToWritableConverter.org$apache$spark$api$python$JavaToWritableConverter$$convertToWritable(PythonHadoopUtil.scala:141)
at org.apache.spark.api.python.JavaToWritableConverter.convert(PythonHadoopUtil.scala:148)
at org.apache.spark.api.python.JavaToWritableConverter.convert(PythonHadoopUtil.scala:118)
at org.apache.spark.api.python.PythonRDD$.org$apache$spark$api$python$PythonRDD$$inferKeyValueTypes(PythonRDD.scala:620)
at org.apache.spark.api.python.PythonRDD$$anonfun$7.apply(PythonRDD.scala:689)
at org.apache.spark.api.python.PythonRDD$$anonfun$7.apply(PythonRDD.scala:689)
at scala.Option.getOrElse(Option.scala:120)
at org.apache.spark.api.python.PythonRDD$.saveAsHadoopFile(PythonRDD.scala:688)
at org.apache.spark.api.python.PythonRDD$.saveAsSequenceFile(PythonRDD.scala:662)
at org.apache.spark.api.python.PythonRDD.saveAsSequenceFile(PythonRDD.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:379)
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:207)
at java.lang.Thread.run(Thread.java:745)

Users with the same issue

You are the first who have seen this exception.

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.