diff options
author | Cody Hiar <cody@hiar.ca> | 2023-08-29 16:21:55 -0600 |
---|---|---|
committer | Cody Hiar <cody@hiar.ca> | 2023-08-29 16:21:55 -0600 |
commit | bee010b99699723432435646486dc8e0ecebbea3 (patch) | |
tree | 73db56d751a8aad14ca4bce90c2421047eccd66f /main.py |
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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) |