You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/11/19 00:33:09 UTC

[GitHub] [spark] hvanhovell opened a new pull request, #38720: [SPARK-41165][SPARK-41184][CONNECT] Fix arrow collect (again) and reenable tests.

hvanhovell opened a new pull request, #38720:
URL: https://github.com/apache/spark/pull/38720

   ### What changes were proposed in this pull request?
   The arrow collect code path for connect contains a bug where it would always fall back to JSON. This was caused by the assumption that `NonFatal(e)` does not match nulls, it unfortunately does. This has been fixed by doing explicit null checks and by reordering the checks in `SparkConnectStreamHandler.processAsArrowBatches`.
   
   ### Why are the changes needed?
   The previous code had a bug and would always fallback to JSON.
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   I added a new test, and I re-enabled the python test disabled in SPARK-41184.


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


[GitHub] [spark] grundprinzip commented on a diff in pull request #38720: [SPARK-41165][SPARK-41184][CONNECT] Fix arrow collect (again) and reenable tests.

Posted by GitBox <gi...@apache.org>.
grundprinzip commented on code in PR #38720:
URL: https://github.com/apache/spark/pull/38720#discussion_r1027137884


##########
connector/connect/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectStreamHandler.scala:
##########
@@ -196,13 +196,14 @@ class SparkConnectStreamHandler(responseObserver: StreamObserver[ExecutePlanResp
               signal.wait()
               result = partitions.remove(currentPartitionId)
             }
-            error match {
-              case NonFatal(e) =>
-                responseObserver.onError(error)
-                logError("Error while processing query.", e)
-                return
-              case fatal: Throwable => throw fatal
-              case null => result.get
+            if (error == null) {
+              result.get
+            } else if (NonFatal(error)) {
+              responseObserver.onError(error)
+              logError("Error while processing query.", error)

Review Comment:
   In theory, logging first then responding might be better in case something goes wrong and onError would throw.



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


[GitHub] [spark] hvanhovell closed pull request #38720: [SPARK-41165][SPARK-41184][CONNECT] Fix arrow collect (again) and reenable tests.

Posted by GitBox <gi...@apache.org>.
hvanhovell closed pull request #38720: [SPARK-41165][SPARK-41184][CONNECT] Fix arrow collect (again) and reenable tests.
URL: https://github.com/apache/spark/pull/38720


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