diff options
author | Tathagata Das <tathagata.das1565@gmail.com> | 2016-11-29 23:08:56 -0800 |
---|---|---|
committer | Tathagata Das <tathagata.das1565@gmail.com> | 2016-11-29 23:08:56 -0800 |
commit | bc09a2b8c3b03a207a6e20627f2c5ec23c1efe8c (patch) | |
tree | da3025cf347f60d962258595f0cafb7d8633c52d /python/pyspark/sql/streaming.py | |
parent | 4c82ca86d979e5526a15666683eef3c79c37dc68 (diff) | |
download | spark-bc09a2b8c3b03a207a6e20627f2c5ec23c1efe8c.tar.gz spark-bc09a2b8c3b03a207a6e20627f2c5ec23c1efe8c.tar.bz2 spark-bc09a2b8c3b03a207a6e20627f2c5ec23c1efe8c.zip |
[SPARK-18516][STRUCTURED STREAMING] Follow up PR to add StreamingQuery.status to Python
## What changes were proposed in this pull request?
- Add StreamingQueryStatus.json
- Make it not case class (to avoid unnecessarily exposing implicit object StreamingQueryStatus, consistent with StreamingQueryProgress)
- Add StreamingQuery.status to Python
- Fix post-termination status
## How was this patch tested?
New unit tests
Author: Tathagata Das <tathagata.das1565@gmail.com>
Closes #16075 from tdas/SPARK-18516-1.
Diffstat (limited to 'python/pyspark/sql/streaming.py')
-rw-r--r-- | python/pyspark/sql/streaming.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/python/pyspark/sql/streaming.py b/python/pyspark/sql/streaming.py index c420b0d016..84f01d3d9a 100644 --- a/python/pyspark/sql/streaming.py +++ b/python/pyspark/sql/streaming.py @@ -90,6 +90,14 @@ class StreamingQuery(object): @property @since(2.1) + def status(self): + """ + Returns the current status of the query. + """ + return json.loads(self._jsq.status().json()) + + @property + @since(2.1) def recentProgresses(self): """Returns an array of the most recent [[StreamingQueryProgress]] updates for this query. The number of progress updates retained for each stream is configured by Spark session |