aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorCody Hiar <cody@hiar.ca>2023-08-29 16:21:55 -0600
committerCody Hiar <cody@hiar.ca>2023-08-29 16:21:55 -0600
commitbee010b99699723432435646486dc8e0ecebbea3 (patch)
tree73db56d751a8aad14ca4bce90c2421047eccd66f /main.py
Very basic example workingHEADmaster
Diffstat (limited to 'main.py')
-rw-r--r--main.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.py b/main.py
new file mode 100644
index 0000000..166a9fc
--- /dev/null
+++ b/main.py
@@ -0,0 +1,9 @@
+from pyspark.sql import SparkSession
+
+spark = SparkSession.builder.getOrCreate()
+dataList = [1, 2, 3, 4, 5]
+rdd = spark.sparkContext.parallelize(dataList)
+rdd2 = rdd.flatMap(lambda x: str(x))
+data = rdd2.collect()
+for x in data:
+ print(type(x), x)