spark-examples / pyspark-examples

Pyspark RDD, DataFrame and Dataset Examples in Python language
https://sparkbyexamples.com
1.17k stars 895 forks source link

AttributeError: 'NoneType' object has no attribute 'rdd' #9

Open pgalimutti opened 2 years ago

pgalimutti commented 2 years ago

Line # 39 keysDF = df.select(explode(map_keys(df.properties))).distinct().show() throws below error:

AttributeError Traceback (most recent call last) in ----> 1 keysList = keysDF.rdd.map(lambda x:x[0]).collect()

AttributeError: 'NoneType' object has no attribute 'rdd'

pgalimutti commented 2 years ago

please ignore, as I added show() at the end of preceeding line of code.