You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "grundprinzip (via GitHub)" <gi...@apache.org> on 2023/07/06 19:37:18 UTC

[GitHub] [spark] grundprinzip commented on a diff in pull request #41880: [SPARK-44263][CONNECT] Custom Interceptors Support

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


##########
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 `client()` method is `private[sql]` for anyone providing any kinds of wrappers on top of the SparkSession for custom auth integrations it's not possible to use this method.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org