Details
-
New Feature
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
best practice for managing SparkContexts involves exception handling, e.g.
try: sc = SparkContext() app(sc) finally: sc.stop()
python provides the "with" statement to simplify this code, e.g.
with SparkContext() as sc: app(sc)
the SparkContext should be usable in a "with" statement
Attachments
Issue Links
- is related to
-
SPARK-2972 APPLICATION_COMPLETE not created in Python unless context explicitly stopped
- Closed
-
SPARK-3470 Have JavaSparkContext implement Closeable/AutoCloseable
- Resolved
-
SPARK-3471 Automatic resource manager for SparkContext in Scala?
- Resolved
- links to
(1 links to)