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 2019/06/11 21:29:03 UTC
[GitHub] [spark] dvogelbacher commented on a change in pull request #24834:
[WIP][SPARK-27992][PYTHON] Synchronize with Python connection thread to
propagate errors
dvogelbacher commented on a change in pull request #24834: [WIP][SPARK-27992][PYTHON] Synchronize with Python connection thread to propagate errors
URL: https://github.com/apache/spark/pull/24834#discussion_r292665619
##########
File path: python/pyspark/sql/dataframe.py
##########
@@ -2200,10 +2200,13 @@ def _collectAsArrow(self):
.. note:: Experimental.
"""
with SCCallSiteSync(self._sc) as css:
- sock_info = self._jdf.collectAsArrowToPython()
+ port, auth_secret, jserver_obj = self._jdf.collectAsArrowToPython()
# Collect list of un-ordered batches where last element is a list of correct order indices
- results = list(_load_from_socket(sock_info, ArrowCollectSerializer()))
+ from pyspark.rdd import _create_local_socket
+ sock_file = _create_local_socket((port, auth_secret))
+ results = list(ArrowCollectSerializer().load_stream(sock_file))
+ jserver_obj.getResult() # Join serving thread and raise any exceptions
Review comment:
we might want to have this in a `finally` clause, so that if we have an error during serialization (which might be caused by an exception in the JVM) we will still get the original exception.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org