It seems sparkcontext is good fit to be used with 'with' in python. A context
manager will do.
example:
with SparkContext(conf=conf, batchSize=512) as sc:
....
Then sc.stop() is not necessary to write any more.
--
View this message in context:
http://apache-spark-user-list.1001560.n3.nabble.com/suggest-pyspark-using-with-for-sparkcontext-to-be-more-pythonic-tp18863.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]