-
-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
Hi! I made some updates in my project from Spark 3.4.1 to Spark 3.5.0 and updated the scalapb dependency from sparksql34-scalapb0_11 to sparksql35-scalapb0_11. After this upgrade, I faced this error:
java.lang.NoSuchMethodError: org.apache.spark.sql.catalyst.expressions.objects.StaticInvoke.<init>(Ljava/lang/Class;Lorg/apache/spark/sql/types/DataType;Ljava/lang/String;Lscala/collection/Seq;Lscala/collection/Seq;ZZZ)V
at scalapb.spark.ToCatalystHelpers.fieldToCatalyst(ToCatalystHelpers.scala:165)
at scalapb.spark.ToCatalystHelpers.fieldToCatalyst$(ToCatalystHelpers.scala:107)
at scalapb.spark.Implicits$$anon$1.fieldToCatalyst(TypedEncoders.scala:123)
at scalapb.spark.ToCatalystHelpers.$anonfun$messageToCatalyst$2(ToCatalystHelpers.scala:39)
I run my jobs in a Databricks environment using Runtime 14.3 LTS (includes Apache Spark 3.5.0, Scala 2.12) and my udf that performs the protobuf decoder is defined as
import org.apache.log4j.Logger
import org.apache.spark.sql.Column
import scalapb.spark.ProtoSQL
import example.root.root.{Event => RootEvent}
import scalapb.spark.Implicits.{messageTypedEncoder, typedEncoderToEncoder}
import scala.util.{Failure, Success, Try}
object ProtobufExample extends Serializable {
val logger: Logger = org.apache.log4j.LogManager.getLogger(this.getClass.getSimpleName)
val rootDecoderUdf: Column => Column = ProtoSQL.udf(Protobuf.decodeRootEvent)
def decodeRootEvent(input: Array[Byte]): Option[RootEvent] = {
val result = Try {
RootEvent.parseFrom(input)
}
result match {
case Success(value) => Some(value)
case Failure(e) =>
logger.error(s"Decode error:", e)
None
}
}
}
Could you help me how to figure out this error?
Metadata
Metadata
Assignees
Labels
No labels