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


##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -439,7 +440,23 @@ 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 reader = new ArrowStreamReader(localRelation.getData.newInput(), 
allocator)
+      reader.loadNextBatch()

Review Comment:
   Sorry. I forgot it.



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