[SPARK-13807] De-duplicate `Python*Helper` instantiation code in PySpark streaming
This patch de-duplicates code in PySpark streaming which loads the `Python*Helper` classes. I also changed a few `raise e` statements to simply `raise` in order to preserve the full exception stacktrace when re-throwing. Here's a link to the whitespace-change-free diff: https://github.com/apache/spark/compare/master...JoshRosen:pyspark-reflection-deduplication?w=0 Author: Josh Rosen <joshro...@databricks.com> Closes #11641 from JoshRosen/pyspark-reflection-deduplication. Project: http://git-wip-us.apache.org/repos/asf/bahir/repo Commit: http://git-wip-us.apache.org/repos/asf/bahir/commit/c66dcf7e Tree: http://git-wip-us.apache.org/repos/asf/bahir/tree/c66dcf7e Diff: http://git-wip-us.apache.org/repos/asf/bahir/diff/c66dcf7e Branch: refs/heads/master Commit: c66dcf7e38420893fe9c1d9fb4ed66b8d6f589ac Parents: 41ae1d2 Author: Josh Rosen <joshro...@databricks.com> Authored: Fri Mar 11 11:18:51 2016 -0800 Committer: Shixiong Zhu <shixi...@databricks.com> Committed: Fri Mar 11 11:18:51 2016 -0800 ---------------------------------------------------------------------- streaming-mqtt/python/mqtt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bahir/blob/c66dcf7e/streaming-mqtt/python/mqtt.py ---------------------------------------------------------------------- diff --git a/streaming-mqtt/python/mqtt.py b/streaming-mqtt/python/mqtt.py index 3a515ea..388e952 100644 --- a/streaming-mqtt/python/mqtt.py +++ b/streaming-mqtt/python/mqtt.py @@ -48,7 +48,7 @@ class MQTTUtils(object): except Py4JJavaError as e: if 'ClassNotFoundException' in str(e.java_exception): MQTTUtils._printErrorMsg(ssc.sparkContext) - raise e + raise return DStream(jstream, ssc, UTF8Deserializer())