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

Samebug tips

  1. ,

    Automatic conversion does not work for uff arguments.

    Example: val add1 = udf {p: Long => p + 1} should be invoked using add1(lit(0L)). add1(lit(0))will throw this exception.

Solutions on the web

via Stack Overflow by jigsaw
, 1 year ago
test.spark.SampleTest$A cannot be cast to java.lang.Long
via GitHub by kscaldef
, 8 months ago
java.lang.Integer cannot be cast to java.lang.Long
via JIRA by Gregor Heine, 1 year ago
java.lang.Integer cannot be cast to java.lang.Long
via Stack Overflow by Patrick
, 9 months ago
java.lang.Double cannot be cast to java.lang.Long
via Stack Overflow by igx
, 1 month ago
java.lang.String cannot be cast to java.lang.Long
java.lang.ClassCastException: test.spark.SampleTest$A cannot be cast to java.lang.Long at scala.runtime.BoxesRunTime.unboxToLong(BoxesRunTime.java:110) at org.apache.spark.sql.catalyst.expressions.BaseGenericInternalRow$class.getLong(rows.scala:42) at org.apache.spark.sql.catalyst.expressions.GenericInternalRow.getLong(rows.scala:221) at org.apache.spark.sql.catalyst.CatalystTypeConverters$LongConverter$.toScalaImpl(CatalystTypeConverters.scala:367)