Check out example codes for "ValueError: Cannot run multiple SparkContexts at once;". It will help you in understanding the concepts better.

Code Example 1

sc = SparkContext.getOrCreate();

Learn ReactJs, React Native from akashmittal.com