amaliujia commented on code in PR #40692:
URL: https://github.com/apache/spark/pull/40692#discussion_r1160953776


##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/connect/client/SparkResult.scala:
##########
@@ -60,13 +61,19 @@ private[sql] class SparkResult[T](
   private def processResponses(stopOnFirstNonEmptyResponse: Boolean): Boolean 
= {
     while (responses.hasNext) {
       val response = responses.next()
+      if (response.hasSchema) {
+        structType =

Review Comment:
   This logic actual becomes more confusing now about the structType assingment.
   
   I am wondering if it should becomes something like
   ```
   if (response.hasSchema)
   else if (response.hasArrowBatch)
   ```
   
   I am becoming not sure as the code is 
   1. if response gives a schema, use it
   2. if response didn't give then try arrow's schema 
   
   then how to handle when both `response has a schema` and `arrow has schema` 
is not clear, or which one should be used first, etc. Per my read the response 
schema and arrow schema could be even not consistent? 



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