zhengruifeng commented on PR #49648:
URL: https://github.com/apache/spark/pull/49648#issuecomment-2612078082

   ```
   from pyspark.ml.feature import *
   
   df = spark.createDataFrame(
   [
         (0, 3, 5.0, 0.0),
         (1, 4, 5.0, 1.0),
         (2, 3, 5.0, 0.0),
         (0, 4, 6.0, 1.0),
         (1, 3, 6.0, 0.0),
         (2, 4, 6.0, 1.0),
         (0, 3, 7.0, 0.0),
         (1, 4, 8.0, 1.0),
         (2, 3, 9.0, 0.0),
   ],
   schema="input1 short, input2 int, input3 double, label double",
   )
   encoder = TargetEncoder(
   inputCols=["input1", "input2", "input3"],
   outputCols=["output", "output2", "output3"],
   labelCol="label",
   targetType="binary",
   )
   model = encoder.fit(df)
   model.write().overwrite().save("/tmp/ta")
   TargetEncoderModel.load("/tmp/ta")
   ```
   
   fails with
   ```
   java.lang.NullPointerException
        at 
org.apache.spark.connect.proto.FetchErrorDetailsResponse$Error$Builder.setMessage(FetchErrorDetailsResponse.java:5654)
        at 
org.apache.spark.sql.connect.utils.ErrorUtils$.throwableToFetchErrorDetailsResponse(ErrorUtils.scala:89)
        at 
org.apache.spark.sql.connect.service.SparkConnectFetchErrorDetailsHandler.$anonfun$handle$1(SparkConnectFetchErrorDetailsHandler.scala:51)
        at scala.Option.map(Option.scala:242)
        at 
org.apache.spark.sql.connect.service.SparkConnectFetchErrorDetailsHandler.handle(SparkConnectFetchErrorDetailsHandler.scala:44)
        at 
org.apache.spark.sql.connect.service.SparkConnectService.fetchErrorDetails(SparkConnectService.scala:224)
        at 
org.apache.spark.connect.proto.SparkConnectServiceGrpc$MethodHandlers.invoke(SparkConnectServiceGrpc.java:935)
        at 
org.sparkproject.connect.grpc.io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
        at 
org.sparkproject.connect.grpc.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:356)
        at 
org.sparkproject.connect.grpc.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:861)
        at 
org.sparkproject.connect.grpc.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
        at 
org.sparkproject.connect.grpc.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to