HI I am trying to iterate over pyspark data frame without using spark_df.collect()
and I am trying foreach and map method is there any other way to iterate?
df.foreach(lambda x: print(x))
and
def func1(x):
firstname=x.firstname
lastName=x.lastName
name=firstName+","+lastName
gender=x.gender.lower()
salary=x.salary*2
return (name,gender,salary)```
```rdd2=df.rdd.map(lambda x: func1(x))```
is there any other way to iterate over data frame