From 9a10a02c07a19654e6a4a097485da1b271b883d2 Mon Sep 17 00:00:00 2001 From: shellygoyal15 <56556313+shellygoyal15@users.noreply.github.com> Date: Thu, 1 Oct 2020 11:50:55 +0530 Subject: [PATCH] collect --- 8.1 max-temperatures.py.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/8.1 max-temperatures.py.py b/8.1 max-temperatures.py.py index 5150d0a..97d5076 100644 --- a/8.1 max-temperatures.py.py +++ b/8.1 max-temperatures.py.py @@ -1,4 +1,5 @@ from pyspark import SparkConf, SparkContext +import sparkSession conf = SparkConf().setMaster("local").setAppName("MaxTemperatures") sc = SparkContext(conf = conf) @@ -17,6 +18,7 @@ def parseLine(line): stationTemps = maxTemps.map(lambda x: (x[0], x[2])) maxTemps = stationTemps.reduceByKey(lambda x, y: max(x,y)) results = maxTemps.collect(); +lines=my.lines.collect() for result in results: print(result[0] + "\t{:.2f}F".format(result[1]))