cdkrot commented on code in PR #41880:
URL: https://github.com/apache/spark/pull/41880#discussion_r1254845934


##########
connector/connect/client/jvm/src/test/scala/org/apache/spark/sql/connect/client/SparkConnectClientSuite.scala:
##########
@@ -123,6 +122,28 @@ class SparkConnectClientSuite extends ConnectFunSuite with 
BeforeAndAfterEach {
     assert(df.plan === service.getAndClearLatestInputPlan())
   }
 
+  test("CustomInterceptor") {
+    startDummyServer(0)
+    client = SparkConnectClient
+      .builder()
+      .connectionString(s"sc://localhost:${server.getPort}")
+      .interceptor(new ClientInterceptor {
+        override def interceptCall[ReqT, RespT](
+                                                 methodDescriptor: 
MethodDescriptor[ReqT, RespT],
+                                                 callOptions: CallOptions,
+                                                 channel: Channel): 
ClientCall[ReqT, RespT] = {
+          throw new RuntimeException("Blocked")
+        }
+      })
+      .build()
+
+    val session = SparkSession.builder().client(client).create()

Review Comment:
   The proposed usage is rather
   
   `SparkSession.builder().interceptor(my interceptor).create()`
   
   Perhaps I should add a test doing this exact line nearby



-- 
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