hvanhovell commented on code in PR #40782:
URL: https://github.com/apache/spark/pull/40782#discussion_r1173246221


##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -439,7 +439,20 @@ class SparkSession private[sql] (
   }
 
   private[sql] def execute[T](plan: proto.Plan, encoder: AgnosticEncoder[T]): 
SparkResult[T] = {
-    val value = client.execute(plan)
+    val value = if (plan.hasRoot && plan.getRoot.hasLocalRelation) {
+      // Short circuit local relation RPCs
+      val localRelation = plan.getRoot.getLocalRelation
+      val response = proto.ExecutePlanResponse.newBuilder()
+      val batch = proto.ExecutePlanResponse.ArrowBatch
+        .newBuilder()
+        .setData(localRelation.getData)
+        .build()
+      response.setArrowBatch(batch).setIsLocalBuilt(true)

Review Comment:
   Why do we need this? I don't think we should change the protocol for this.



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