[ 
https://issues.apache.org/jira/browse/SPARK-44388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hyukjin Kwon reassigned SPARK-44388:
------------------------------------

    Assignee: Venkata Sai Akhil Gudesa

> Using an updated instance of ScalarUserDefinedFunction causes protobuf cast 
> failures on server
> ----------------------------------------------------------------------------------------------
>
>                 Key: SPARK-44388
>                 URL: https://issues.apache.org/jira/browse/SPARK-44388
>             Project: Spark
>          Issue Type: Bug
>          Components: Connect
>    Affects Versions: 3.5.0
>            Reporter: Venkata Sai Akhil Gudesa
>            Assignee: Venkata Sai Akhil Gudesa
>            Priority: Major
>
> When running the following code-
> {code:java}
> class A(x: Int) { def get = x * 7 }
> val myUdf = udf((x: Int) => new A(x).get)
> val modifiedUdf = myUdf.withName("myUdf")
> spark.range(5).select(modifiedUdf(col("id"))).as[Int].collect(){code}
> which modifies the original myUdf instance through the `withName` method 
> causes the following error to occur during execution:
> {noformat}
> java.lang.ClassCastException: org.apache.spark.connect.proto.ScalarScalaUDF 
> cannot be cast to com.google.protobuf.MessageLite
>     at 
> com.google.protobuf.GeneratedMessageLite$SerializedForm.readResolve(GeneratedMessageLite.java:1462)
>     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 
> java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1274)
>     at 
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2196)
>     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1667)
>     at 
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2405)
>     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2285)
>     at 
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2187)
>     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1667)
>     at 
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2405)
>     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2329)
>     at 
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2187)
>     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1667)
>     at java.io.ObjectInputStream.readArray(ObjectInputStream.java:2093)
>     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1655)
>     at 
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2405)
>     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2329)
>     at 
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2187)
>     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1667)
>     at 
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2405)
>     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2329)
>     at 
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2187)
>     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1667)
>     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:503)
>     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:461)
>     at org.apache.spark.util.Utils$.deserialize(Utils.scala:148){noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to