dillitz commented on code in PR #41829:
URL: https://github.com/apache/spark/pull/41829#discussion_r1251944195


##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/connect/client/SparkConnectClient.scala:
##########
@@ -79,7 +107,11 @@ private[sql] class SparkConnectClient(
       .setSessionId(sessionId)
       .setClientType(userAgent)
       .build()
-    stub.executePlan(request)
+    retry {
+      val result = stub.executePlan(request)
+      result.hasNext // moves evaluation of BlockingResponseStream to 
SparkConnectClient

Review Comment:
   The problem was that `execute` returns a lazily evaluated 
`java.util.Iterator[proto.ExecutePlanResponse]` that is then used in 
`SparkResult.processResponses` where `responses.hasNext` fails with a 
`StatusRuntimeException` outside of  the `retry` block. As suggested by 
Hyukjin, I now created a custom Iterator that solves this problem.



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